Kouhei Sutou
null+****@clear*****
Wed Jan 9 13:19:18 JST 2013
Kouhei Sutou 2013-01-09 13:19:18 +0900 (Wed, 09 Jan 2013) New Revision: c982ab6d53b1e214db2e34a92b944a4ca118396f https://github.com/groonga/groonga/commit/c982ab6d53b1e214db2e34a92b944a4ca118396f Log: Embed mruby to grn_ctx_impl It just embed. We cannot run Ruby code yet. We need likethe following code to run Ruby code: { mrb_state *mrb = ctx->impl->mrb; struct mrb_parser_state *state; int code_start_index; state = mrb_parse_string(mrb, "p Time.now", NULL); code_start_index = mrb_generate_code(mrb, state); mrb_pool_close(state->pool); mrb_run(mrb, mrb_proc_new(mrb, mrb->irep[code_start_index]), mrb_nil_value()); } Added files: vendor/mruby-b5830ae/.gitignore vendor/mruby-b5830ae/.travis.yml vendor/mruby-b5830ae/AUTHORS vendor/mruby-b5830ae/CONTRIBUTING.md vendor/mruby-b5830ae/ChangeLog vendor/mruby-b5830ae/INSTALL vendor/mruby-b5830ae/LEGAL vendor/mruby-b5830ae/MITL vendor/mruby-b5830ae/NEWS vendor/mruby-b5830ae/README.md vendor/mruby-b5830ae/Rakefile vendor/mruby-b5830ae/TODO vendor/mruby-b5830ae/benchmark/ao-render.rb vendor/mruby-b5830ae/benchmark/bm_so_lists.rb vendor/mruby-b5830ae/build_config.rb vendor/mruby-b5830ae/doc/.gitkeep vendor/mruby-b5830ae/doc/compile/README.md vendor/mruby-b5830ae/doc/mrbgems/README.md vendor/mruby-b5830ae/doc/mrbgems/c_and_ruby_extension_example/README.md vendor/mruby-b5830ae/doc/mrbgems/c_and_ruby_extension_example/mrbgem.rake vendor/mruby-b5830ae/doc/mrbgems/c_and_ruby_extension_example/mrblib/example.rb vendor/mruby-b5830ae/doc/mrbgems/c_and_ruby_extension_example/src/example.c vendor/mruby-b5830ae/doc/mrbgems/c_and_ruby_extension_example/test/example.rb vendor/mruby-b5830ae/doc/mrbgems/c_extension_example/README.md vendor/mruby-b5830ae/doc/mrbgems/c_extension_example/mrbgem.rake vendor/mruby-b5830ae/doc/mrbgems/c_extension_example/src/example.c vendor/mruby-b5830ae/doc/mrbgems/c_extension_example/test/example.c vendor/mruby-b5830ae/doc/mrbgems/c_extension_example/test/example.rb vendor/mruby-b5830ae/doc/mrbgems/ruby_extension_example/README.md vendor/mruby-b5830ae/doc/mrbgems/ruby_extension_example/mrbgem.rake vendor/mruby-b5830ae/doc/mrbgems/ruby_extension_example/mrblib/example.rb vendor/mruby-b5830ae/doc/mrbgems/ruby_extension_example/test/example.rb vendor/mruby-b5830ae/include/mrbconf.h vendor/mruby-b5830ae/include/mruby.h vendor/mruby-b5830ae/include/mruby/array.h vendor/mruby-b5830ae/include/mruby/cdump.h vendor/mruby-b5830ae/include/mruby/class.h vendor/mruby-b5830ae/include/mruby/compile.h vendor/mruby-b5830ae/include/mruby/data.h vendor/mruby-b5830ae/include/mruby/dump.h vendor/mruby-b5830ae/include/mruby/hash.h vendor/mruby-b5830ae/include/mruby/irep.h vendor/mruby-b5830ae/include/mruby/khash.h vendor/mruby-b5830ae/include/mruby/numeric.h vendor/mruby-b5830ae/include/mruby/proc.h vendor/mruby-b5830ae/include/mruby/range.h vendor/mruby-b5830ae/include/mruby/string.h vendor/mruby-b5830ae/include/mruby/struct.h vendor/mruby-b5830ae/include/mruby/value.h vendor/mruby-b5830ae/include/mruby/variable.h vendor/mruby-b5830ae/minirake vendor/mruby-b5830ae/mrblib/array.rb vendor/mruby-b5830ae/mrblib/class.rb vendor/mruby-b5830ae/mrblib/compar.rb vendor/mruby-b5830ae/mrblib/enum.rb vendor/mruby-b5830ae/mrblib/error.rb vendor/mruby-b5830ae/mrblib/hash.rb vendor/mruby-b5830ae/mrblib/init_mrblib.c vendor/mruby-b5830ae/mrblib/kernel.rb vendor/mruby-b5830ae/mrblib/mrblib.rake vendor/mruby-b5830ae/mrblib/numeric.rb vendor/mruby-b5830ae/mrblib/print.rb vendor/mruby-b5830ae/mrblib/range.rb vendor/mruby-b5830ae/mrblib/string.rb vendor/mruby-b5830ae/mrblib/struct.rb vendor/mruby-b5830ae/src/array.c vendor/mruby-b5830ae/src/cdump.c vendor/mruby-b5830ae/src/class.c vendor/mruby-b5830ae/src/codegen.c vendor/mruby-b5830ae/src/compar.c vendor/mruby-b5830ae/src/crc.c vendor/mruby-b5830ae/src/dump.c vendor/mruby-b5830ae/src/encoding.h vendor/mruby-b5830ae/src/enum.c vendor/mruby-b5830ae/src/error.c vendor/mruby-b5830ae/src/error.h vendor/mruby-b5830ae/src/etc.c vendor/mruby-b5830ae/src/ext/.gitkeep vendor/mruby-b5830ae/src/gc.c vendor/mruby-b5830ae/src/hash.c vendor/mruby-b5830ae/src/init.c vendor/mruby-b5830ae/src/init_ext.c vendor/mruby-b5830ae/src/kernel.c vendor/mruby-b5830ae/src/keywords vendor/mruby-b5830ae/src/lex.def vendor/mruby-b5830ae/src/load.c vendor/mruby-b5830ae/src/math.c vendor/mruby-b5830ae/src/mrblib.c vendor/mruby-b5830ae/src/mruby_core.rake vendor/mruby-b5830ae/src/name2ctype.h vendor/mruby-b5830ae/src/node.h vendor/mruby-b5830ae/src/numeric.c vendor/mruby-b5830ae/src/object.c vendor/mruby-b5830ae/src/oniguruma.h vendor/mruby-b5830ae/src/opcode.h vendor/mruby-b5830ae/src/parse.y vendor/mruby-b5830ae/src/pool.c vendor/mruby-b5830ae/src/print.c vendor/mruby-b5830ae/src/proc.c vendor/mruby-b5830ae/src/range.c vendor/mruby-b5830ae/src/re.c vendor/mruby-b5830ae/src/re.h vendor/mruby-b5830ae/src/regcomp.c vendor/mruby-b5830ae/src/regenc.c vendor/mruby-b5830ae/src/regenc.h vendor/mruby-b5830ae/src/regerror.c vendor/mruby-b5830ae/src/regex.h vendor/mruby-b5830ae/src/regexec.c vendor/mruby-b5830ae/src/regint.h vendor/mruby-b5830ae/src/regparse.c vendor/mruby-b5830ae/src/regparse.h vendor/mruby-b5830ae/src/sprintf.c vendor/mruby-b5830ae/src/st.c vendor/mruby-b5830ae/src/st.h vendor/mruby-b5830ae/src/state.c vendor/mruby-b5830ae/src/string.c vendor/mruby-b5830ae/src/struct.c vendor/mruby-b5830ae/src/symbol.c vendor/mruby-b5830ae/src/time.c vendor/mruby-b5830ae/src/variable.c vendor/mruby-b5830ae/src/vm.c vendor/mruby-b5830ae/tasks/libmruby.rake vendor/mruby-b5830ae/tasks/mrbgems.rake vendor/mruby-b5830ae/tasks/mrbgems_test.rake vendor/mruby-b5830ae/tasks/mruby_build.rake vendor/mruby-b5830ae/tasks/mruby_gem_spec.rake vendor/mruby-b5830ae/tasks/ruby_ext.rake vendor/mruby-b5830ae/tasks/rules.rake vendor/mruby-b5830ae/test/README.md vendor/mruby-b5830ae/test/assert.rb vendor/mruby-b5830ae/test/driver.c vendor/mruby-b5830ae/test/init_mrbtest.c vendor/mruby-b5830ae/test/mrbtest.rake vendor/mruby-b5830ae/test/report.rb vendor/mruby-b5830ae/test/t/argumenterror.rb vendor/mruby-b5830ae/test/t/array.rb vendor/mruby-b5830ae/test/t/basicobject.rb vendor/mruby-b5830ae/test/t/bs_block.rb vendor/mruby-b5830ae/test/t/bs_literal.rb vendor/mruby-b5830ae/test/t/class.rb vendor/mruby-b5830ae/test/t/comparable.rb vendor/mruby-b5830ae/test/t/enumerable.rb vendor/mruby-b5830ae/test/t/exception.rb vendor/mruby-b5830ae/test/t/false.rb vendor/mruby-b5830ae/test/t/float.rb vendor/mruby-b5830ae/test/t/gc.rb vendor/mruby-b5830ae/test/t/hash.rb vendor/mruby-b5830ae/test/t/indexerror.rb vendor/mruby-b5830ae/test/t/integer.rb vendor/mruby-b5830ae/test/t/kernel.rb vendor/mruby-b5830ae/test/t/literals.rb vendor/mruby-b5830ae/test/t/localjumperror.rb vendor/mruby-b5830ae/test/t/math.rb vendor/mruby-b5830ae/test/t/module.rb vendor/mruby-b5830ae/test/t/nameerror.rb vendor/mruby-b5830ae/test/t/nil.rb vendor/mruby-b5830ae/test/t/nomethoderror.rb vendor/mruby-b5830ae/test/t/numeric.rb vendor/mruby-b5830ae/test/t/object.rb vendor/mruby-b5830ae/test/t/proc.rb vendor/mruby-b5830ae/test/t/range.rb vendor/mruby-b5830ae/test/t/rangeerror.rb vendor/mruby-b5830ae/test/t/regexperror.rb vendor/mruby-b5830ae/test/t/runtimeerror.rb vendor/mruby-b5830ae/test/t/standarderror.rb vendor/mruby-b5830ae/test/t/string.rb vendor/mruby-b5830ae/test/t/struct.rb vendor/mruby-b5830ae/test/t/symbol.rb vendor/mruby-b5830ae/test/t/syntax.rb vendor/mruby-b5830ae/test/t/time.rb vendor/mruby-b5830ae/test/t/true.rb vendor/mruby-b5830ae/test/t/typeerror.rb vendor/mruby-b5830ae/tools/mirb/mirb.c vendor/mruby-b5830ae/tools/mirb/mirb.rake vendor/mruby-b5830ae/tools/mrbc/mrbc.c vendor/mruby-b5830ae/tools/mrbc/mrbc.rake vendor/mruby-b5830ae/tools/mruby/mruby.c vendor/mruby-b5830ae/tools/mruby/mruby.rake vendor/mruby/Makefile.am vendor/mruby/sources.am vendor/mruby/update.sh vendor/mruby/update_files.sh Modified files: .gitignore Makefile.am configure.ac lib/Makefile.am lib/ctx.c lib/ctx_impl.h vendor/Makefile.am Modified: .gitignore (+1 -0) =================================================================== --- .gitignore 2013-01-08 18:16:25 +0900 (25a9177) +++ .gitignore 2013-01-09 13:19:18 +0900 (115ea97) @@ -34,6 +34,7 @@ /groonga-httpd-conf.sh /data/groonga-httpd.conf /vendor/nginx-1.2.1/objs +/vendor/mruby/parse.c /groonga.spec /stamp-h1 /CMakeCache.txt Modified: Makefile.am (+3 -0) =================================================================== --- Makefile.am 2013-01-08 18:16:25 +0900 (5190bfa) +++ Makefile.am 2013-01-09 13:19:18 +0900 (174b6c1) @@ -142,6 +142,9 @@ update-files: cd doc && $(MAKE) update-files cd data/html && $(MAKE) update-files +update-mruby: + cd $(top_srcdir)/vendor/mruby && make update + misc: @if test -z "$(CUTTER_SOURCE_PATH)"; then \ echo "\$$(CUTTER_SOURCE_PATH) is missing"; \ Modified: configure.ac (+43 -0) =================================================================== --- configure.ac 2013-01-08 18:16:25 +0900 (ba6836e) +++ configure.ac 2013-01-09 13:19:18 +0900 (5aebc07) @@ -71,6 +71,7 @@ AC_MSG_RESULT([$solaris]) AC_C_BIGENDIAN AC_PROG_CXX AC_PROG_CC +AC_PROG_YACC AM_PROG_CC_C_O m4_ifdef([PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG([0.19]) @@ -286,6 +287,7 @@ AC_CONFIG_FILES([ test/benchmark/fixtures/geo-select/Makefile test/benchmark/lib/Makefile vendor/Makefile + vendor/mruby/Makefile ]) if test "$GCC" = "yes"; then @@ -1244,6 +1246,45 @@ else fi AM_CONDITIONAL(WITH_GROONGA_HTTPD, test "$enable_groonga_httpd" = "yes") +# mruby +AC_ARG_ENABLE(mruby, + [AS_HELP_STRING([--enable-mruby], + [enable mruby. [default=auto]])], + [enable_mruby="$enableval"], + [enable_mruby="auto"]) + +if test "x$enable_mruby" = "xyes"; then + if test "x$ac_cv_ruby_available" != "xyes"; then + AC_MSG_ERROR([Ruby is required for mruby support.]) + fi +elif test "x$enable_mruby" = "xauto"; then + AC_MSG_CHECKING([whether enable mruby]) + if test "$ac_cv_ruby_available" = "yes"; then + enable_mruby="yes" + else + enable_mruby="no" + fi + AC_MSG_RESULT($enable_mruby) +else + enable_mruby="no" +fi + +m4_define([mruby_version], m4_include(mruby_version)) +MRUBY_VERSION=mruby_version +AC_SUBST(MRUBY_VERSION) + +if test "$enable_mruby" = "yes"; then + AC_DEFINE(WITH_MRUBY, [1], [Define to 1 if mruby is enabled.]) + MRUBY_CFLAGS="-I\$(top_srcdir)/vendor/mruby-${MRUBY_VERSION}/include" + MRUBY_LIBS="\$(top_builddir)/vendor/mruby/libmruby.la" +else + MRUBY_CFLAGS= + MRUBY_LIBS= +fi +AC_SUBST(MRUBY_CFLAGS) +AC_SUBST(MRUBY_LIBS) +AM_CONDITIONAL(WITH_MRUBY, test "$enable_mruby" = "yes") + # PCRE WITH_PCRE=no AC_ARG_WITH(pcre, @@ -1358,6 +1399,7 @@ if test "x$message_pack_available" = "xyes"; then echo " CFLAGS: ${MESSAGE_PACK_CFLAGS}" echo " LIBS: ${MESSAGE_PACK_LIBS}" fi +echo " mruby: $enable_mruby" echo echo "groonga-httpd:" @@ -1374,6 +1416,7 @@ echo echo "Tools:" # echo " Sphinx: ${enable_sphinx}" +echo " yacc: ${YACC}" echo " hg: ${HG}" echo " Ruby: ${RUBY}" echo " Cutter: ${CUTTER}" Modified: lib/Makefile.am (+4 -2) =================================================================== --- lib/Makefile.am 2013-01-08 18:16:25 +0900 (03dc1f4) +++ lib/Makefile.am 2013-01-09 13:19:18 +0900 (8ce864a) @@ -7,7 +7,8 @@ AM_CFLAGS = \ $(NO_STRICT_ALIASING_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(GRN_CFLAGS) \ - $(MESSAGE_PACK_CFLAGS) + $(MESSAGE_PACK_CFLAGS) \ + $(MRUBY_CFLAGS) DEFAULT_INCLUDES = -I$(top_builddir) -I$(top_srcdir)/include DEFS += -D_REENTRANT $(GRN_DEFS) -DGRN_DAT_EXPORT @@ -20,7 +21,8 @@ libgroonga_la_LDFLAGS = \ libgroonga_la_LIBADD = \ dat/libgrndat.la \ - $(MESSAGE_PACK_LIBS) + $(MESSAGE_PACK_LIBS) \ + $(MRUBY_LIBS) EXTRA_DIST = \ ecmascript.c \ Modified: lib/ctx.c (+7 -0) =================================================================== --- lib/ctx.c 2013-01-08 18:16:25 +0900 (590f45f) +++ lib/ctx.c 2013-01-09 13:19:18 +0900 (332f95b) @@ -507,6 +507,10 @@ grn_ctx_impl_init(grn_ctx *ctx) #ifdef WITH_MESSAGE_PACK msgpack_packer_init(&ctx->impl->msgpacker, ctx, grn_msgpack_buffer_write); #endif + +#ifdef WITH_MRUBY + ctx->impl->mrb = mrb_open(); +#endif } void @@ -592,6 +596,9 @@ grn_ctx_fin(grn_ctx *ctx) if (ctx->impl->finalizer) { ctx->impl->finalizer(ctx, 0, NULL, &(ctx->user_data)); } +#ifdef WITH_MRUBY + mrb_close(ctx->impl->mrb); +#endif grn_ctx_loader_clear(ctx); if (ctx->impl->parser) { grn_expr_parser_close(ctx); Modified: lib/ctx_impl.h (+9 -0) =================================================================== --- lib/ctx_impl.h 2013-01-08 18:16:25 +0900 (791fd75) +++ lib/ctx_impl.h 2013-01-09 13:19:18 +0900 (d1e9292) @@ -30,6 +30,12 @@ #include <msgpack.h> #endif +#ifdef WITH_MRUBY +# include <mruby.h> +# include <mruby/proc.h> +# include <mruby/compile.h> +#endif + #ifdef __cplusplus extern "C" { #endif @@ -168,6 +174,9 @@ struct _grn_ctx_impl { #ifdef WITH_MESSAGE_PACK msgpack_packer msgpacker; #endif +#ifdef WITH_MRUBY + mrb_state *mrb; +#endif }; #ifdef __cplusplus Modified: vendor/Makefile.am (+19 -10) =================================================================== --- vendor/Makefile.am 2013-01-08 18:16:25 +0900 (d569ce1) +++ vendor/Makefile.am 2013-01-09 13:19:18 +0900 (0842f46) @@ -1,10 +1,15 @@ -# nginx's Makefile specify 'build' as the default rule. -# This isn't compatible with the 'all' default rule generated by Automake -# So, override the all rule. - -if WITH_GROONGA_HTTPD NGINX_DIR = nginx-1.2.1 +MRUBY_DIR = mruby-$(MRUBY_VERSION) + +SUBDIRS = mruby +EXTRA_DIST = \ + nginx \ + $(NGINX_DIR) \ + mruby \ + $(MRUBY_DIR) + +if WITH_GROONGA_HTTPD NGINX_MAKEILE = $(NGINX_DIR)/Makefile NGINX_MAKEFILE_DEPEND_FILES = \ nginx/configure \ @@ -17,14 +22,18 @@ $(NGINX_MAKEILE): $(NGINX_MAKEFILE_DEPEND_FILES) $(SHELL) "$(abs_top_srcdir)/vendor/nginx/configure" \ `../../config.status --config`) -all-local: $(NGINX_MAKEILE) +# nginx's Makefile specify 'build' as the default rule. +# This isn't compatible with the 'all' default rule generated by Automake +# So, override the all rule. +all-nginx: $(NGINX_MAKEILE) (cd $(NGINX_DIR) && $(MAKE) build) +all-local: all-nginx -clean-local: $(NGINX_MAKEILE) +clean-nginx: $(NGINX_MAKEILE) (cd $(NGINX_DIR) && $(MAKE) clean) +clean-local: clean-nginx -install-exec-local: $(NGINX_MAKEILE) +install-exec-nginx: $(NGINX_MAKEILE) (cd $(NGINX_DIR) && $(MAKE) install) +install-exec-local: install-exec-nginx endif - -EXTRA_DIST = nginx $(NGINX_DIR) Added: vendor/mruby-b5830ae/.gitignore (+16 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/.gitignore 2013-01-09 13:19:18 +0900 (ac8f673) @@ -0,0 +1,16 @@ +# / +*.bak +*.orig +*.rej +*.sav +*.swp +*.tmp +*~ +.DS_Store +.ccmalloc +.svn +/.git +cscope.out +/src/y.tab.c +/bin +/build Added: vendor/mruby-b5830ae/.travis.yml (+3 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/.travis.yml 2013-01-09 13:19:18 +0900 (109013b) @@ -0,0 +1,3 @@ +# no installation... + +script: "./minirake all test" Added: vendor/mruby-b5830ae/AUTHORS (+12 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/AUTHORS 2013-01-09 13:19:18 +0900 (dc5d7a5) @@ -0,0 +1,12 @@ +Original Authors "mruby developers" are: + Yukihiro Matsumoto + FUKUOKA CSK CORPORATION + Kyushu Institute of Technology + Network Applied Communication Laboratory, Inc. + Daniel Bovensiepen + Jon Maken + Bjorn De Meyer + Yuichiro MASUI + Masamitsu MURASE + Masaki Muranaka + Internet Initiative Japan Inc. Added: vendor/mruby-b5830ae/CONTRIBUTING.md (+65 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/CONTRIBUTING.md 2013-01-09 13:19:18 +0900 (0899597) @@ -0,0 +1,65 @@ +# How to contribute + +mruby is an open-source project which is looking forward to each contribution. + +## Your Pull Request + +To make it easy to review and understand your change please keep the following +things in mind before submitting your pull request: + +* Work on the latest possible state of **mruby/master** +* Test your changes before creating a pull request (**make test**) +* If possible write a test case which confirms your change +* Don't mix several features or bug-fixes in one pull request +* Create a branch which is dedicated to your change +* Create a meaningful commit message +* Explain your change (i.e. with a link to the issue you are fixing) + +## Coding conventions + +How to style your C and Ruby code which you want to submit. + +### C code + +The core part (parser, bytecode-interpreter, core-lib, etc.) of mruby is +written in the C programming language. Please note the following hints for your +C code: + +#### Comply with C99 (ISO/IEC 9899:1999) + +mruby should be highly portable to other systems and compilers. For that it is +recommended to keep your code as close as possible to the C99 standard +(http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf). + +Although we target C99, VC is also an important target for mruby, so that we +avoid local variable declaration in the middle. + +#### Reduce library dependencies to a minimum + +The dependencies to libraries should be put to an absolute minimum. This +increases the portability but makes it also easier to cut away parts of mruby +on-demand. + +#### Don't use C++ style comments + + /* This is the prefered comment style */ + +Use C++ style comments only for temporary comment e.g. commenting out some code lines. + +#### Insert a break after the method return value: + + int + main(void) + { + ... + } + +### Ruby code + +Parts of the standard library of mruby is written in the Ruby programming language +itself. Please note the following hints for your Ruby code: + +#### Comply with the Ruby standard (ISO/IEC 30170:2012) + +mruby is currently targeting to execute Ruby code which complies to ISO/IEC +30170:2012 (http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=59579). Added: vendor/mruby-b5830ae/ChangeLog (+15 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/ChangeLog 2013-01-09 13:19:18 +0900 (93a18f4) @@ -0,0 +1,15 @@ +Thu Apl 19 17:25:18 2012 Yukihiro Matsumoto <matz �� ruby-lang.org> + + * first release version 1.0.0 released. + +Local variables: +add-log-time-format: (lambda () + (let* ((time (current-time)) + (system-time-locale "C") + (diff (+ (cadr time) 32400)) + (lo (% diff 65536)) + (hi (+ (car time) (/ diff 65536)))) + (format-time-string "%a %b %e %H:%M:%S %Y" (list hi lo) t))) +indent-tabs-mode: t +tab-width: 8 +end: Added: vendor/mruby-b5830ae/INSTALL (+29 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/INSTALL 2013-01-09 13:19:18 +0900 (5bad4aa) @@ -0,0 +1,29 @@ +* Prerequisites + + 1. Make sure you have bison (http://www.gnu.org/software/bison/) installed in your system. + 2. Make sure you have ruby installed in your system (required to build). + +* Compilation and Installation + + 1. Run make in the top directory. + + This command will create the following directories and + store libraries and binaries files into them. + + * bin + * lib + * include + + You can directory invoke 'minirake' as the following. + + $ ruby ./minirake + +If an error occurs when compiling mruby, it will be helpful for others if you +send a detailed report to the developers that includes the error log, machine, +and OS type. + + +* Porting to other platforms + + +That's all. Added: vendor/mruby-b5830ae/LEGAL (+8 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/LEGAL 2013-01-09 13:19:18 +0900 (036b35a) @@ -0,0 +1,8 @@ +LEGAL NOTICE INFORMATION +------------------------ + +All the files in this distribution are covered under the MIT license +(see the file MITL) except some files mentioned below: + + +(Currently no items are listed.) Added: vendor/mruby-b5830ae/MITL (+20 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/MITL 2013-01-09 13:19:18 +0900 (484dcff) @@ -0,0 +1,20 @@ +Copyright (c) 2012 mruby developers + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + Added: vendor/mruby-b5830ae/NEWS (+13 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/NEWS 2013-01-09 13:19:18 +0900 (5c25238) @@ -0,0 +1,13 @@ +* NEWS + +This document is a list of user visible feature changes made between +releases except for bug fixes. + +Note that each entry is kept so brief that no reason behind or +reference information is supplied with. For a full list of changes +with all sufficient information, see the ChangeLog file. + + +** Information about first release v1.0.0 + + Added: vendor/mruby-b5830ae/README.md (+115 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/README.md 2013-01-09 13:19:18 +0900 (69ca995) @@ -0,0 +1,115 @@ +# !!Notice!! + This is a preliminary release for internal team review. + The URLs and addresses described below are not available yet. + The official release will be announced later. + Any suggestion for modification is welcome. + Delays in replies are to be expected. Sorry in advance. + +## What's mruby + +mruby is the lightweight implementation of the Ruby language complying to (part of) +the [ISO standard](http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=59579). +mruby can be linked and embedded within your application. We provide the interpreter program "mruby" and +the interactive mruby shell "mirb" as examples. You can also compile Ruby programs into compiled byte code +using the mruby compiler "mrbc". All those tools reside in "bin" directory. The "mrbc" is also able to +generate compiled byte code in a C source file. You can check the "mrbtest" program under the "test" directory. + +This achievement was sponsored by the Regional Innovation Creation R&D Programs of +the Ministry of Economy, Trade and Industry of Japan. + + +## How to get mruby + +The mruby distribution files can be found in the following site: + + https://github.com/mruby/mruby/zipball/master + +The trunk of the mruby source tree can be checked out with the +following command: + + $ git clone https://github.com/mruby/mruby.git + +There are some other branches under development. Try the following +command and see the list of branches: + + $ git branch -r + + +## mruby home-page + +mruby's website is not launched yet but we are actively working on it. + +The URL of the mruby home-page will be: + + http://www.mruby.org/ + + +## Mailing list + +To subscribe to the mruby mailing list....[T.B.D.] + + +## How to compile and install + +See the INSTALL file. + +## Running Tests + +To run the tests, execute the following from the project's root directory. + + $ make test + +Or + + $ ruby ./minirake test + +## Customization + +mruby contains a package manager called *mrbgems*. To create extensions +in C and/or Ruby you should create a *GEM*. You will find a complete +documentation with examples under *doc/mrbgems*. + +## License + +Copyright (c) 2012 mruby developers + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +## Note for License + +mruby has chosen a MIT License due to its permissive license allowing +developers to target various environments such as embedded systems. +However, the license requires the display of the copyright notice and license +information in manuals for instance. Doing so for big projects can be +complicated or troublesome. +This is why mruby has decided to display "mruby developers" as the copyright name +to make it simple conventionally. +In the future, mruby might ask you to distribute your new code +(that you will commit,) under the MIT License as a member of +"mruby developers" but contributors will keep their copyright. +(We did not intend for contributors to transfer or waive their copyrights, + Actual copyright holder name (contributors) will be listed in the AUTHORS file.) + +Please ask us if you want to distribute your code under another license. + +## How to Contribute + +Send pull request to <http://github.com/mruby/mruby>. We consider you have granted +non-exclusive right to your contributed code under MIT license. If you want to be named +as one of mruby developers, include update to the AUTHORS file in your pull request. Added: vendor/mruby-b5830ae/Rakefile (+61 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/Rakefile 2013-01-09 13:19:18 +0900 (d31af96) @@ -0,0 +1,61 @@ +# encoding: utf-8 +# Build description. +# basic build file for mruby + +load 'tasks/ruby_ext.rake' +load 'tasks/mruby_build.rake' +load 'tasks/mruby_gem_spec.rake' + +############################## +# compile flags +load File.expand_path(ENV['CONFIG'] || './build_config.rb') + +load 'tasks/rules.rake' +load 'src/mruby_core.rake' +load 'mrblib/mrblib.rake' +load 'tools/mrbc/mrbc.rake' + +load 'tasks/mrbgems.rake' +load 'tasks/libmruby.rake' +load 'tools/mruby/mruby.rake' +load 'tools/mirb/mirb.rake' + +load 'tasks/mrbgems_test.rake' +load 'test/mrbtest.rake' + +############################## +# generic build targets, rules +task :default => :all + +binfiles = [exefile('bin/mruby'), exefile('bin/mirb'), exefile('bin/mrbc')] + +desc "build all targets, install (locally) in-repo" +task :all => binfiles + MRuby.targets.map { |t| [exefile("#{t.build_dir}/bin/mruby"), exefile("#{t.build_dir}/bin/mirb"), exefile("#{t.build_dir}/bin/mrbc")] }.flatten + +file exefile('bin/mruby') => exefile('build/host/bin/mruby') do |t| + FileUtils.cp t.prerequisites.first, t.name +end + +file exefile('bin/mirb') => exefile('build/host/bin/mirb') do |t| + FileUtils.cp t.prerequisites.first, t.name +end + +file exefile('bin/mrbc') => exefile('build/host/bin/mrbc') do |t| + FileUtils.cp t.prerequisites.first, t.name +end + +desc "run all mruby tests" +task :test => MRuby.targets.map { |t| exefile("#{t.build_dir}/test/mrbtest") } do + sh "#{filename exefile('build/host/test/mrbtest')}" + if MRuby.targets.count > 1 + puts "\nYou should run #{MRuby.targets.map{ |t| t.name == 'host' ? nil : "#{t.build_dir}/test/mrbtest" }.compact.join(', ')} on target device." + end +end + +desc "clean all built and in-repo installed artifacts" +task :clean do + MRuby.targets.each do |t| + FileUtils.rm_rf t.build_dir + end + FileUtils.rm_f binfiles +end Added: vendor/mruby-b5830ae/TODO (+15 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/TODO 2013-01-09 13:19:18 +0900 (f8e463b) @@ -0,0 +1,15 @@ +Things to do (Things that are not done yet) + +* Here document +* Special variables ($1,$2..) +* super in aliased methods +* BEGIN/END (Were we not supporting this?) +* const_missing +* respond_to_missing + +Things to improve (Done but things to fix) + +* Hash (Reduce size. Use khash or save the order) +* stringEx (Delete encoding、delete CODERANGE、delete everything except UTF-8 or ASCII) +* Make additions as they are noticed. + Added: vendor/mruby-b5830ae/benchmark/ao-render.rb (+315 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/benchmark/ao-render.rb 2013-01-09 13:19:18 +0900 (793804a) @@ -0,0 +1,315 @@ +# AO render benchmark +# Original program (C) Syoyo Fujita in Javascript (and other languages) +# http://lucille.atso-net.jp/blog/?p=642 +# http://lucille.atso-net.jp/blog/?p=711 +# Ruby(yarv2llvm) version by Hideki Miura +# mruby version by Hideki Miura +# + +IMAGE_WIDTH = 256 +IMAGE_HEIGHT = 256 +NSUBSAMPLES = 2 +NAO_SAMPLES = 8 + +module Rand + # Use xorshift + @@x = 123456789 + @@y = 362436069 + @@z = 521288629 + @@w = 88675123 + BNUM = 1 << 29 + BNUMF = BNUM.to_f + def self.rand + x = @@x + t = x ^ ((x & 0xfffff) << 11) + w = @@w + @@x, @@y, @@z = @@y, @@z, w + w = @@w = (w ^ (w >> 19) ^ (t ^ (t >> 8))) + (w % BNUM) / BNUMF + end +end + +class Vec + def initialize(x, y, z) + @x = x + @y = y + @z = z + end + + def x=(v); @x = v; end + def y=(v); @y = v; end + def z=(v); @z = v; end + def x; @x; end + def y; @y; end + def z; @z; end + + def vadd(b) + Vec.new(@x + b.x, @y + b.y, @z + b.z) + end + + def vsub(b) + Vec.new(@x - b.x, @y - b.y, @z - b.z) + end + + def vcross(b) + Vec.new(@y * b.z - @z * b.y, + @z * b.x - @x * b.z, + @x * b.y - @y * b.x) + end + + def vdot(b) + r = @x * b.x + @y * b.y + @z * b.z + r + end + + def vlength + Math.sqrt(@x * @x + @y * @y + @z * @z) + end + + def vnormalize + len = vlength + v = Vec.new(@x, @y, @z) + if len > 1.0e-17 then + v.x = v.x / len + v.y = v.y / len + v.z = v.z / len + end + v + end +end + + +class Sphere + def initialize(center, radius) + @center = center + @radius = radius + end + + def center; @center; end + def radius; @radius; end + + def intersect(ray, isect) + rs = ray.org.vsub(@center) + b = rs.vdot(ray.dir) + c = rs.vdot(rs) - (@radius * @radius) + d = b * b - c + if d > 0.0 then + t = - b - Math.sqrt(d) + + if t > 0.0 and t < isect.t then + isect.t = t + isect.hit = true + isect.pl = Vec.new(ray.org.x + ray.dir.x * t, + ray.org.y + ray.dir.y * t, + ray.org.z + ray.dir.z * t) + n = isect.pl.vsub(@center) + isect.n = n.vnormalize + end + end + end +end + +class Plane + def initialize(p, n) + @p = p + @n = n + end + + def intersect(ray, isect) + d = - �� p.vdot(@n) + v = ray.dir.vdot(@n) + v0 = v + if v < 0.0 then + v0 = -v + end + if v0 < 1.0e-17 then + return + end + + t = -(ray.org.vdot(@n) + d) / v + + if t > 0.0 and t < isect.t then + isect.hit = true + isect.t = t + isect.n = @n + isect.pl = Vec.new(ray.org.x + t * ray.dir.x, + ray.org.y + t * ray.dir.y, + ray.org.z + t * ray.dir.z) + end + end +end + +class Ray + def initialize(org, dir) + @org = org + @dir = dir + end + + def org; @org; end + def org=(v); @org = v; end + def dir; @dir; end + def dir=(v); @dir = v; end +end + +class Isect + def initialize + @t = 10000000.0 + @hit = false + @pl = Vec.new(0.0, 0.0, 0.0) + @n = Vec.new(0.0, 0.0, 0.0) + end + + def t; @t; end + def t=(v); @t = v; end + def hit; @hit; end + def hit=(v); @hit = v; end + def pl; @pl; end + def pl=(v); @pl = v; end + def n; @n; end + def n=(v); @n = v; end +end + +def clamp(f) + i = f * 255.5 + if i > 255.0 then + i = 255.0 + end + if i < 0.0 then + i = 0.0 + end + i.to_i +end + +def otherBasis(basis, n) + basis[2] = Vec.new(n.x, n.y, n.z) + basis[1] = Vec.new(0.0, 0.0, 0.0) + + if n.x < 0.6 and n.x > -0.6 then + basis[1].x = 1.0 + elsif n.y < 0.6 and n.y > -0.6 then + basis[1].y = 1.0 + elsif n.z < 0.6 and n.z > -0.6 then + basis[1].z = 1.0 + else + basis[1].x = 1.0 + end + + basis[0] = basis[1].vcross(basis[2]) + basis[0] = basis[0].vnormalize + + basis[1] = basis[2].vcross(basis[0]) + basis[1] = basis[1].vnormalize +end + +class Scene + def initialize + @spheres = Array.new + @spheres[0] = Sphere.new(Vec.new(-2.0, 0.0, -3.5), 0.5) + @spheres[1] = Sphere.new(Vec.new(-0.5, 0.0, -3.0), 0.5) + @spheres[2] = Sphere.new(Vec.new(1.0, 0.0, -2.2), 0.5) + @plane = Plane.new(Vec.new(0.0, -0.5, 0.0), Vec.new(0.0, 1.0, 0.0)) + end + + def ambient_occlusion(isect) + basis = Array.new(3) + otherBasis(basis, isect.n) + + ntheta = NAO_SAMPLES + nphi = NAO_SAMPLES + eps = 0.0001 + occlusion = 0.0 + + p0 = Vec.new(isect.pl.x + eps * isect.n.x, + isect.pl.y + eps * isect.n.y, + isect.pl.z + eps * isect.n.z) + nphi.times do |j| + ntheta.times do |i| + r = Rand::rand + phi = 2.0 * 3.14159265 * Rand::rand + x = Math.cos(phi) * Math.sqrt(1.0 - r) + y = Math.sin(phi) * Math.sqrt(1.0 - r) + z = Math.sqrt(r) + + rx = x * basis[0].x + y * basis[1].x + z * basis[2].x + ry = x * basis[0].y + y * basis[1].y + z * basis[2].y + rz = x * basis[0].z + y * basis[1].z + z * basis[2].z + + raydir = Vec.new(rx, ry, rz) + ray = Ray.new(p0, raydir) + + occisect = Isect.new + @spheres[0].intersect(ray, occisect) + @spheres[1].intersect(ray, occisect) + @spheres[2].intersect(ray, occisect) + @plane.intersect(ray, occisect) + if occisect.hit then + occlusion = occlusion + 1.0 + else + 0.0 + end + end + end + + occlusion = (ntheta.to_f * nphi.to_f - occlusion) / (ntheta.to_f * nphi.to_f) + Vec.new(occlusion, occlusion, occlusion) + end + + def render(w, h, nsubsamples) + cnt = 0 + nsf = nsubsamples.to_f + h.times do |y| + w.times do |x| + rad = Vec.new(0.0, 0.0, 0.0) + + # Subsmpling + nsubsamples.times do |v| + nsubsamples.times do |u| + cnt = cnt + 1 + wf = w.to_f + hf = h.to_f + xf = x.to_f + yf = y.to_f + uf = u.to_f + vf = v.to_f + + px = (xf + (uf / nsf) - (wf / 2.0)) / (wf / 2.0) + py = -(yf + (vf / nsf) - (hf / 2.0)) / (hf / 2.0) + + eye = Vec.new(px, py, -1.0).vnormalize + + ray = Ray.new(Vec.new(0.0, 0.0, 0.0), eye) + + isect = Isect.new + @spheres[0].intersect(ray, isect) + @spheres[1].intersect(ray, isect) + @spheres[2].intersect(ray, isect) + @plane.intersect(ray, isect) + if isect.hit then + col = ambient_occlusion(isect) + rad.x = rad.x + col.x + rad.y = rad.y + col.y + rad.z = rad.z + col.z + else + 0.0 + end + end + end + + r = rad.x / (nsf * nsf) + g = rad.y / (nsf * nsf) + b = rad.z / (nsf * nsf) + printf("%c", clamp(r)) + printf("%c", clamp(g)) + printf("%c", clamp(b)) + end + end + end +end + +# File.open("ao.ppm", "w") do |fp| + printf("P6\n") + printf("%d %d\n", IMAGE_WIDTH, IMAGE_HEIGHT) + printf("255\n", IMAGE_WIDTH, IMAGE_HEIGHT) + Scene.new.render(IMAGE_WIDTH, IMAGE_HEIGHT, NSUBSAMPLES) +# Scene.new.render(256, 256, 2) +# end Added: vendor/mruby-b5830ae/benchmark/bm_so_lists.rb (+47 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/benchmark/bm_so_lists.rb 2013-01-09 13:19:18 +0900 (f8d2679) @@ -0,0 +1,47 @@ +#from http://www.bagley.org/~doug/shootout/bench/lists/lists.ruby + +NUM = 300 +SIZE = 10000 + +def test_lists() + # create a list of integers (Li1) from 1 to SIZE + li1 = (1..SIZE).to_a + # copy the list to li2 (not by individual items) + li2 = li1.dup + # remove each individual item from left side of li2 and + # append to right side of li3 (preserving order) + li3 = Array.new + while (not li2.empty?) + li3.push(li2.shift) + end + # li2 must now be empty + # remove each individual item from right side of li3 and + # append to right side of li2 (reversing list) + while (not li3.empty?) + li2.push(li3.pop) + end + # li3 must now be empty + # reverse li1 in place + li1.reverse! + # check that first item is now SIZE + if li1[0] != SIZE then + p "not SIZE" + 0 + else + # compare li1 and li2 for equality + if li1 != li2 then + return(0) + else + # return the length of the list + li1.length + end + end +end + +i = 0 +while i<NUM + i+=1 + result = test_lists() +end + +result Added: vendor/mruby-b5830ae/build_config.rb (+53 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/build_config.rb 2013-01-09 13:19:18 +0900 (93ccc1a) @@ -0,0 +1,53 @@ +MRuby::Build.new do |conf| + conf.cc = ENV['CC'] || 'gcc' + conf.ld = ENV['LD'] || 'gcc' + conf.ar = ENV['AR'] || 'ar' + # conf.cxx = conf.cc + # conf.objcc = conf.cc + # conf.asm = conf.cc + # conf.yacc = 'bison' + # conf.gperf = 'gperf' + # conf.cat = 'cat' + # conf.git = 'git' + + conf.cflags << (ENV['CFLAGS'] || %w(-g -O3 -Wall -Werror-implicit-function-declaration)) + conf.ldflags << (ENV['LDFLAGS'] || %w(-lm)) + # conf.cxxflags = [] + # conf.objccflags = [] + # conf.asmflags = [] + + # conf.gem 'doc/mrbgems/ruby_extension_example' + # conf.gem 'doc/mrbgems/c_extension_example' + # conf.gem 'doc/mrbgems/c_and_ruby_extension_example' + # conf.gem :git => 'git �� github.com:masuidrive/mrbgems-example.git', :branch => 'master' +end + +=begin +MRuby::CrossBuild.new('i386') do |conf| + conf.cc = ENV['CC'] || 'gcc' + conf.ld = ENV['LD'] || 'gcc' + conf.ar = ENV['AR'] || 'ar' + # conf.cxx = 'gcc' + # conf.objcc = 'gcc' + # conf.asm = 'gcc' + # conf.yacc = 'bison' + # conf.gperf = 'gperf' + # conf.cat = 'cat' + # conf.git = 'git' + + if ENV['OS'] == 'Windows_NT' # MinGW + conf.cflags = %w(-g -O3 -Wall -Werror-implicit-function-declaration -Di386_MARK) + conf.ldflags = %w(-s -static) + else + conf.cflags << %w(-g -O3 -Wall -Werror-implicit-function-declaration -arch i386) + conf.ldflags << %w(-arch i386) + end + # conf.cxxflags << [] + # conf.objccflags << [] + # conf.asmflags << [] + + # conf.gem 'doc/mrbgems/ruby_extension_example' + # conf.gem 'doc/mrbgems/c_extension_example' + # conf.gem 'doc/mrbgems/c_and_ruby_extension_example' +end +=end \ No newline at end of file Added: vendor/mruby-b5830ae/doc/.gitkeep (+0 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/.gitkeep 2013-01-09 13:19:18 +0900 (e69de29) Added: vendor/mruby-b5830ae/doc/compile/README.md (+212 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/compile/README.md 2013-01-09 13:19:18 +0900 (e68c0d6) @@ -0,0 +1,212 @@ +# Compile + +mruby is using Rake to compile and cross-compile all libraries and +binaries. + +## Prerequisites + +To compile mruby out of the source code you need the following tools: +* C Compiler (i.e. ```gcc```) +* Linker (i.e. ```gcc```) +* Archive utility (i.e. ```ar```) +* Parser generator (i.e. ```bison```) +* Ruby 1.8 or 1.9 + +Optional: +* GIT (to update mruby source and integrate mrbgems easier) +* C++ compiler (to use GEMs which include *.cpp) +* Assembler (to use GEMs which include *.asm) + +## Usage + +Inside of the root directory of the mruby source exist a file +called *build_config.rb*. This file contains the build configuration +of mruby and looks like this for example: + +``` +MRuby::Build.new do |conf| + conf.cc = ENV['CC'] || 'gcc' + conf.ld = ENV['LD'] || 'gcc' + conf.ar = ENV['AR'] || 'ar' + + conf.cflags << (ENV['CFLAGS'] || %w(-g -O3 -Wall -Werror-implicit-function-declaration)) + conf.ldflags << (ENV['LDFLAGS'] || %w(-lm)) +end +``` + +All tools necessary to compile mruby can be set or modified here. +The following options can be configurated: + +* conf.cc (C compiler) +* conf.ld (Linker) +* conf.ar (Archive utility) +* conf.cxx (C++ compiler) +* conf.objcc (Object compiler) +* conf.asm (Assembler) +* conf.yacc (Parser Generator) +* conf.gperf (Hash function Generator) +* conf.cat (Concatenate utility) +* conf.git (GIT content tracker) +* conf.cflags (C compiler flags) +* conf.ldflags (Linker flags) +* conf.cxxflags (C++ compiler flags) +* conf.objccflags (Object compiler flags) +* conf.asmflags (Assembler flags) +* conf.gem (A GEM which should be integrated - can be set several times) + +To compile just call ```./minirake``` inside of the mruby source root. To +generate the test tool environment call ```./minirake test```. To clean +all build files call ```./minirake clean```. + +### Cross-Compilation + +mruby can also be cross-compiled from one platform to another. To +achive this the *build_config.rb* needs to contain an instance of +```MRuby::CrossBuild```. This instance defines the compilation +tools and flags for the target platform. An example could look +like this for example: + +``` +MRuby::CrossBuild.new('i386') do |conf| + conf.cc = ENV['CC'] || 'gcc' + conf.ld = ENV['LD'] || 'gcc' + conf.ar = ENV['AR'] || 'ar' + + if ENV['OS'] == 'Windows_NT' # MinGW + conf.cflags = %w(-g -O3 -Wall -Werror-implicit-function-declaration -Di386_MARK) + conf.ldflags = %w(-s -static) + else + conf.cflags << %w(-g -O3 -Wall -Werror-implicit-function-declaration -arch i386) + conf.ldflags << %w(-arch i386) + end +end +``` + +You can configurate the same options as for a normal build. + +## Build process + +During the build process the directory *build* will be created. The +directory structure will look like this: + +``` ++- build + | + +- host + | + +- bin <- Binaries (mirb, mrbc and mruby) + | + +- lib <- Libraries (libmruby.a and libmruby_core.a) + | + +- mrblib + | + +- src + | + +- test <- mrbtest tool + | + +- tools + | + +- mirb + | + +- mrbc + | + +- mruby +``` + +The compilation workflow will look like this: +* compile all files under *src* (object files will be stored +in *build/host/src* +* generate parser grammar out of *src/parse.y* (generated +result will be stored in *build/host/src/y.tab.c* +* compile *build/host/src/y.tab.c* to *build/host/src/y.tab.o* +* create *build/host/lib/libmruby_core.a* out of all object files (C only) +* create ```build/host/bin/mrbc``` by compile *tools/mrbc/mrbc.c* and +link with *build/host/lib/libmruby_core.a* +* create *build/host/mrblib/mrblib.c* by compiling all *.rb files +under *mrblib* with ```build/host/bin/mrbc``` +* compile *build/host/mrblib/mrblib.c* to *build/host/mrblib/mrblib.o* +* create *build/host/lib/libmruby.a* out of all object files (C and Ruby) +* create ```build/host/bin/mruby``` by compile *tools/mruby/mruby.c* and +link with *build/host/lib/libmruby.a* +* create ```build/host/bin/mirb``` by compile *tools/mirb/mirb.c* and +link with *build/host/lib/libmruby.a* + +### Cross-Compilation + +In case of a cross-compilation to *i386* the *build* directory structure looks +like this: + +``` ++- build + | + +- host + | | + | +- bin <- Native Binaries + | | + | +- lib <- Native Libraries + | | + | +- mrblib + | | + | +- src + | | + | +- test <- Native mrbtest tool + | | + | +- tools + | | + | +- mirb + | | + | +- mrbc + | | + | +- mruby + +- i386 + | + +- bin <- Cross-compiled Binaries + | + +- lib <- Cross-compiled Libraries + | + +- mrblib + | + +- src + | + +- test <- Cross-compiled mrbtest tool + | + +- tools + | + +- mirb + | + +- mrbc + | + +- mruby +``` + +An extra directory is created for the target platform. In case you +compile for *i386* a directory called *i386* is created under the +build direcotry. + +The cross compilation workflow starts in the same way as the normal +compilation by compiling all *native* libraries and binaries. +Aftwards the cross compilation process proceeds like this: +* cross-compile all files under *src* (object files will be stored +in *build/i386/src* +* generate parser grammar out of *src/parse.y* (generated +result will be stored in *build/i386/src/y.tab.c* +* cross-compile *build/i386/src/y.tab.c* to *build/i386/src/y.tab.o* +* create *build/i386/mrblib/mrblib.c* by compiling all *.rb files +under *mrblib* with the native ```build/host/bin/mrbc``` +* cross-compile *build/host/mrblib/mrblib.c* to *build/host/mrblib/mrblib.o* +* create *build/i386/lib/libmruby.a* out of all object files (C and Ruby) +* create ```build/i386/bin/mruby``` by cross-compile *tools/mruby/mruby.c* and +link with *build/i386/lib/libmruby.a* +* create ```build/i386/bin/mirb``` by cross-compile *tools/mirb/mirb.c* and +link with *build/i386/lib/libmruby.a* +* create *build/i386/lib/libmruby_core.a* out of all object files (C only) +* create ```build/i386/bin/mrbc``` by cross-compile *tools/mrbc/mrbc.c* and +link with *build/i386/lib/libmruby_core.a* + +## Test Environment + +mruby's build process includes a test environment. In case you start the testing +of mruby, a native binary called ```mrbtest``` will be generated and executed. +This binary contains all test cases which are defined under *test/t*. In case +of a cross-compilation an additional cross-compiled *mrbtest* binary is +generated. This binary you can copy and run on your target system. Added: vendor/mruby-b5830ae/doc/mrbgems/README.md (+184 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/mrbgems/README.md 2013-01-09 13:19:18 +0900 (9e930d8) @@ -0,0 +1,184 @@ +# mrbgems + +mrbgems is a library manager to integrate C and Ruby extension in an easy and +standardised way into mruby. + +## Usage + +By default mrbgems is currently deactivated. As soon as you add a GEM to your +build configuration (*build_config.rb*), mrbgems will be activated and the +extension integrated. + +To add a GEM into the build_config.rb add the following line for example: + +``` +conf.gem '/path/to/your/gem/dir' +``` + +You can also use a relative path which would be relative from the mruby root: + +``` +conf.gem 'doc/mrbgems/ruby_extension_example' +``` + +A remote GIT repository location for a GEM is also supported: + +``` +conf.gem :git => 'https://github.com/masuidrive/mrbgems-example.git', :branch => 'master' +``` + +``` +conf.gem :github => 'masuidrive/mrbgems-example', :branch => 'master' +``` + + +## GEM Structure + +The maximal GEM structure looks like this: + +``` ++- GEM_NAME <- Name of GEM + | + +- mrblib/ <- Source for Ruby extension + | + +- src/ <- Source for C extension + | + +- test/ <- Test code (Ruby) + | + +- mrbgem.rake <- GEM Specification + | + +- README.md <- Readme for GEM +``` + +The folder *mrblib* contains pure Ruby files to extend mruby. The folder *src* +contains C files to extend mruby. The folder *test* contains C and pure Ruby files +for testing purposes which will be used by ```mrbtest```. *mrbgem.rake* contains +the specification to compile C and Ruby files. *README.md* is a short description +of your GEM. + +## Build process + +mrbgems expects a specifcation file called *mrbgem.rake* inside of your +GEM direcotry. A typical GEM specification could look like this for example: + +``` +MRuby::Gem::Specification.new('c_and_ruby_extension_example') do |spec| + spec.license = 'MIT' + spec.authors = 'mruby developers' +end +``` + +The mrbgems build process will use this specification to compile Object and Ruby +files. The compilation results will be add to *lib/libmruby.a*. This file is used +by tools like ```mruby``` and ```mirb``` to empower the GEM functionality. + +In case your GEM has more complex build requirements you can use +the following options additionally inside of your GEM specification: + +* spec.cflags (C compiler flags for this GEM) +* spec.mruby_cflags (global C compiler flags for everything) +* spec.mruby_ldflags (global linker flags for everything) +* spec.mruby_libs (global libraries for everything) +* spec.mruby_includes (global includes for everything) +* spec.rbfiles (Ruby files to compile) +* spec.objs (Object files to compile) +* spec.test_rbfiles (Ruby test files for integration into mrbtest) +* spec.test_objs (Object test files for integration into mrbtest) +* spec.test_preload (Initialization files for mrbtest) + +## C Extension + +mruby can be extended with C. This is possible by using the C API to +integrate C libraries into mruby. + +### Pre-Conditions + +mrbgems expects that you have implemented a C method called +```mrb_YOURGEMNAME_gem_init(mrb_state)```. ```YOURGEMNAME``` will be replaced +by the name of your GEM. If you call your GEM *c_extension_example*, your +initialisation method could look like this: + +``` +void +mrb_c_extension_example_gem_init(mrb_state* mrb) { + struct RClass *class_cextension = mrb_define_module(mrb, "CExtension"); + mrb_define_class_method(mrb, class_cextension, "c_method", mrb_c_method, ARGS_NONE()); +} +``` + +### Example + +``` ++- c_extension_example/ + | + +- src/ + | | + | +- example.c <- C extension source + | + +- test/ + | | + | +- example.rb <- Test code for C extension + | + +- mrbgem.rake <- GEM specification + | + +- README.md +``` + +## Ruby Extension + +mruby can be extended with pure Ruby. It is possible to override existing +classes or add new ones in this way. Put all Ruby files into the *mrblib* +folder. + +### Pre-Conditions + +none + +### Example + +``` ++- ruby_extension_example/ + | + +- mrblib/ + | | + | +- example.rb <- Ruby extension source + | + +- test/ + | | + | +- example.rb <- Test code for Ruby extension + | + +- mrbgem.rake <- GEM specification + | + +- README.md +``` + +## C and Ruby Extension + +mruby can be extended with C and Ruby at the same time. It is possible to +override existing classes or add new ones in this way. Put all Ruby files +into the *mrblib* folder and all C files into the *src* folder. + +### Pre-Conditions + +See C and Ruby example. + +### Example + +``` ++- c_and_ruby_extension_example/ + | + +- mrblib/ + | | + | +- example.rb <- Ruby extension source + | + +- src/ + | | + | +- example.c <- C extension source + | + +- test/ + | | + | +- example.rb <- Test code for C and Ruby extension + | + +- mrbgem.rake <- GEM specification + | + +- README.md Added: vendor/mruby-b5830ae/doc/mrbgems/c_and_ruby_extension_example/README.md (+4 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/mrbgems/c_and_ruby_extension_example/README.md 2013-01-09 13:19:18 +0900 (0b428b0) @@ -0,0 +1,4 @@ +C and Ruby Extension Example +========= + +This is an example gem which implements a C and Ruby extension. Added: vendor/mruby-b5830ae/doc/mrbgems/c_and_ruby_extension_example/mrbgem.rake (+17 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/mrbgems/c_and_ruby_extension_example/mrbgem.rake 2013-01-09 13:19:18 +0900 (9309436) @@ -0,0 +1,17 @@ +MRuby::Gem::Specification.new('c_and_ruby_extension_example') do |spec| + spec.license = 'MIT' + spec.authors = 'mruby developers' + + # spec.cflags = '' + + # spec.mruby_cflags = '' + # spec.mruby_ldflags = '' + # spec.mruby_libs = '' + # spec.mruby_includes = ["#{spec.dir}/include"] + + # spec.rbfiles = Dir.glob("#{dir}/mrblib/*.rb") + # spec.objs = Dir.glob("#{dir}/src/*.{c,cpp,m,asm,S}").map { |f| f.relative_path_from(dir).pathmap("#{build_dir}/%X.o") } + # spec.test_rbfiles = Dir.glob("#{dir}/test/*.rb") + # spec.test_objs = Dir.glob("#{dir}/test/*.{c,cpp,m,asm,S}").map { |f| f.relative_path_from(dir).pathmap("#{build_dir}/%X.o") } + # spec.test_preload = 'test/assert.rb' +end Added: vendor/mruby-b5830ae/doc/mrbgems/c_and_ruby_extension_example/mrblib/example.rb (+5 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/mrbgems/c_and_ruby_extension_example/mrblib/example.rb 2013-01-09 13:19:18 +0900 (d3899c3) @@ -0,0 +1,5 @@ +module CRubyExtension + def CRubyExtension.ruby_method + puts "A Ruby Extension" + end +end Added: vendor/mruby-b5830ae/doc/mrbgems/c_and_ruby_extension_example/src/example.c (+15 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/mrbgems/c_and_ruby_extension_example/src/example.c 2013-01-09 13:19:18 +0900 (3d3cb20) @@ -0,0 +1,15 @@ +#include <mruby.h> +#include <stdio.h> + +static mrb_value +mrb_c_method(mrb_state *mrb, mrb_value self) +{ + puts("A C Extension"); + return self; +} + +void +mrb_c_and_ruby_extension_example_gem_init(mrb_state* mrb) { + struct RClass *class_cextension = mrb_define_module(mrb, "CRubyExtension"); + mrb_define_class_method(mrb, class_cextension, "c_method", mrb_c_method, ARGS_NONE()); +} Added: vendor/mruby-b5830ae/doc/mrbgems/c_and_ruby_extension_example/test/example.rb (+7 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/mrbgems/c_and_ruby_extension_example/test/example.rb 2013-01-09 13:19:18 +0900 (fffad71) @@ -0,0 +1,7 @@ +assert('C and Ruby Extension Example 1') do + CRubyExtension.respond_to? :c_method +end + +assert('C and Ruby Extension Example 2') do + CRubyExtension.respond_to? :ruby_method +end Added: vendor/mruby-b5830ae/doc/mrbgems/c_extension_example/README.md (+4 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/mrbgems/c_extension_example/README.md 2013-01-09 13:19:18 +0900 (3803c20) @@ -0,0 +1,4 @@ +C Extension Example +========= + +This is an example gem which implements a C extension. Added: vendor/mruby-b5830ae/doc/mrbgems/c_extension_example/mrbgem.rake (+17 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/mrbgems/c_extension_example/mrbgem.rake 2013-01-09 13:19:18 +0900 (289f87d) @@ -0,0 +1,17 @@ +MRuby::Gem::Specification.new('c_extension_example') do |spec| + spec.license = 'MIT' + spec.authors = 'mruby developers' + + # spec.cflags = '' + + # spec.mruby_cflags = '' + # spec.mruby_ldflags = '' + # spec.mruby_libs = '' + # spec.mruby_includes = ["#{spec.dir}/include"] + + # spec.rbfiles = Dir.glob("#{dir}/mrblib/*.rb") + # spec.objs = Dir.glob("#{dir}/src/*.{c,cpp,m,asm,S}").map { |f| f.relative_path_from(dir).pathmap("#{build_dir}/%X.o") } + # spec.test_rbfiles = Dir.glob("#{dir}/test/*.rb") + # spec.test_objs = Dir.glob("#{dir}/test/*.{c,cpp,m,asm,S}").map { |f| f.relative_path_from(dir).pathmap("#{build_dir}/%X.o") } + # spec.test_preload = 'test/assert.rb' +end Added: vendor/mruby-b5830ae/doc/mrbgems/c_extension_example/src/example.c (+15 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/mrbgems/c_extension_example/src/example.c 2013-01-09 13:19:18 +0900 (11f54e6) @@ -0,0 +1,15 @@ +#include <mruby.h> +#include <stdio.h> + +static mrb_value +mrb_c_method(mrb_state *mrb, mrb_value self) +{ + puts("A C Extension"); + return self; +} + +void +mrb_c_extension_example_gem_init(mrb_state* mrb) { + struct RClass *class_cextension = mrb_define_module(mrb, "CExtension"); + mrb_define_class_method(mrb, class_cextension, "c_method", mrb_c_method, ARGS_NONE()); +} Added: vendor/mruby-b5830ae/doc/mrbgems/c_extension_example/test/example.c (+7 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/mrbgems/c_extension_example/test/example.c 2013-01-09 13:19:18 +0900 (ab41033) @@ -0,0 +1,7 @@ +#include <mruby.h> + +void +mrb_c_extension_example_gem_test(mrb_state *mrb) +{ + /* test initializer in C */ +} Added: vendor/mruby-b5830ae/doc/mrbgems/c_extension_example/test/example.rb (+3 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/mrbgems/c_extension_example/test/example.rb 2013-01-09 13:19:18 +0900 (367d180) @@ -0,0 +1,3 @@ +assert('C Extension Example') do + CExtension.respond_to? :c_method +end Added: vendor/mruby-b5830ae/doc/mrbgems/ruby_extension_example/README.md (+4 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/mrbgems/ruby_extension_example/README.md 2013-01-09 13:19:18 +0900 (906a0d8) @@ -0,0 +1,4 @@ +Pure Ruby Extension Example +========= + +This is an example gem which implements a pure Ruby extension. Added: vendor/mruby-b5830ae/doc/mrbgems/ruby_extension_example/mrbgem.rake (+17 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/mrbgems/ruby_extension_example/mrbgem.rake 2013-01-09 13:19:18 +0900 (80a2991) @@ -0,0 +1,17 @@ +MRuby::Gem::Specification.new('ruby_extension_example') do |spec| + spec.license = 'MIT' + spec.authors = 'mruby developers' + + # spec.cflags = '' + + # spec.mruby_cflags = '' + # spec.mruby_ldflags = '' + # spec.mruby_libs = '' + # spec.mruby_includes = ["#{spec.dir}/include"] + + # spec.rbfiles = Dir.glob("#{dir}/mrblib/*.rb") + # spec.objs = Dir.glob("#{dir}/src/*.{c,cpp,m,asm,S}").map { |f| f.relative_path_from(dir).pathmap("#{build_dir}/%X.o") } + # spec.test_rbfiles = Dir.glob("#{dir}/test/*.rb") + # spec.test_objs = Dir.glob("#{dir}/test/*.{c,cpp,m,asm,S}").map { |f| f.relative_path_from(dir).pathmap("#{build_dir}/%X.o") } + # spec.test_preload = 'test/assert.rb' +end Added: vendor/mruby-b5830ae/doc/mrbgems/ruby_extension_example/mrblib/example.rb (+5 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/mrbgems/ruby_extension_example/mrblib/example.rb 2013-01-09 13:19:18 +0900 (b07a2b5) @@ -0,0 +1,5 @@ +class RubyExtension + def RubyExtension.ruby_method + puts "A Ruby Extension" + end +end Added: vendor/mruby-b5830ae/doc/mrbgems/ruby_extension_example/test/example.rb (+3 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/doc/mrbgems/ruby_extension_example/test/example.rb 2013-01-09 13:19:18 +0900 (0c1b634) @@ -0,0 +1,3 @@ +assert('Ruby Extension Example') do + RubyExtension.respond_to? :ruby_method +end Added: vendor/mruby-b5830ae/include/mrbconf.h (+135 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mrbconf.h 2013-01-09 13:19:18 +0900 (80c8bd6) @@ -0,0 +1,135 @@ +/* +** mrbconf.h - mruby core configuration +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBYCONF_H +#define MRUBYCONF_H + +#include <stdint.h> + +/* configuration options: */ +/* add -DMRB_USE_FLOAT to use float instead of double for floating point numbers */ +//#define MRB_USE_FLOAT + +/* add -DMRB_INT64 to use 64bit integer for mrb_int */ +//#define MRB_INT64 + +/* represent mrb_value in boxed double; conflict with MRB_USE_FLOAT */ +//#define MRB_NAN_BOXING + +/* define on big endian machines; used by MRB_NAN_BOXING */ +//#define MRB_ENDIAN_BIG + +/* argv max size in mrb_funcall */ +//#define MRB_FUNCALL_ARGC_MAX 16 + +/* number of object per heap page */ +//#define MRB_HEAP_PAGE_SIZE 1024 + +/* use segmented list for IV table */ +//#define MRB_USE_IV_SEGLIST + +/* initial size for IV khash; ignored when MRB_USE_IV_SEGLIST is set */ +//#define MRB_IVHASH_INIT_SIZE 8 + +/* default size of khash table bucket */ +//#define KHASH_DEFAULT_SIZE 32 + +/* allocated memory address alignment */ +//#define POOL_ALIGNMENT 4 + +/* page size of memory pool */ +//#define POOL_PAGE_SIZE 16000 + +/* -DDISABLE_XXXX to drop the feature */ +#define DISABLE_REGEXP /* regular expression classes */ +//#define DISABLE_SPRINTF /* Kernel.sprintf method */ +//#define DISABLE_MATH /* Math functions */ +//#define DISABLE_TIME /* Time class */ +//#define DISABLE_STRUCT /* Struct class */ +//#define DISABLE_STDIO /* use of stdio */ + +/* Now DISABLE_GEMS is added as a command line flag in Rakefile, */ +/* we do not need to set it here. */ + +#undef HAVE_UNISTD_H /* WINDOWS */ +#define HAVE_UNISTD_H /* LINUX */ + +/* end of configuration */ + +#ifdef MRB_USE_FLOAT + typedef float mrb_float; +# define mrb_float_to_str(buf, i) sprintf((buf), "%.7e", (i)) +# define str_to_mrb_float(buf) (mrb_float)strtof((buf),NULL) +#else + typedef double mrb_float; +# define mrb_float_to_str(buf, i) sprintf((buf), "%.16e", (i)) +# define str_to_mrb_float(buf) (mrb_float)strtod((buf),NULL) +#endif + +#ifdef MRB_NAN_BOXING +# ifdef MRB_INT64 +# error Cannot use NaN boxing when mrb_int is 64bit +# else + typedef int32_t mrb_int; +# define MRB_INT_MIN INT32_MIN +# define MRB_INT_MAX INT32_MAX +# define mrb_int_to_str(buf, i) sprintf((buf), "%d", (i)) +# define str_to_mrb_int(buf) (mrb_int)strtol((buf), NULL, 10) +# endif +#else +# ifdef MRB_INT64 + typedef int64_t mrb_int; +# define MRB_INT_MIN INT64_MIN +# define MRB_INT_MAX INT64_MAX +# define mrb_int_to_str(buf, i) sprintf((buf), "%ld", (i)) +# define str_to_mrb_int(buf) (mrb_int)strtoll((buf), NULL, 10) +# else + typedef int mrb_int; +# define MRB_INT_MIN INT_MIN +# define MRB_INT_MAX INT_MAX +# define mrb_int_to_str(buf, i) sprintf((buf), "%d", (i)) +# define str_to_mrb_int(buf) (mrb_int)strtol((buf), NULL, 10) +# endif +#endif +typedef short mrb_sym; + +/* define ENABLE_XXXX from DISABLE_XXX */ +#ifndef DISABLE_REGEXP +#define ENABLE_REGEXP +#endif +#ifndef DISABLE_SPRINTF +#define ENABLE_SPRINTF +#endif +#ifndef DISABLE_MATH +#define ENABLE_MATH +#endif +#ifndef DISABLE_TIME +#define ENABLE_TIME +#endif +#ifndef DISABLE_STRUCT +#define ENABLE_STRUCT +#endif +#ifndef DISABLE_STDIO +#define ENABLE_STDIO +#endif + +#ifndef FALSE +# define FALSE 0 +#endif + +#ifndef TRUE +# define TRUE 1 +#endif + +#ifdef _MSC_VER +# define inline __inline +# define snprintf _snprintf +# define isnan _isnan +# define isinf(n) (!_finite(n) && !_isnan(n)) +# define strtoll _strtoi64 +#endif + +#endif /* MRUBYCONF_H */ Added: vendor/mruby-b5830ae/include/mruby.h (+346 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby.h 2013-01-09 13:19:18 +0900 (6bc37b4) @@ -0,0 +1,346 @@ +/* +** mruby - An embeddable Ruby implementaion +** +** Copyright (c) mruby developers 2010-2012 +** +** Permission is hereby granted, free of charge, to any person obtaining +** a copy of this software and associated documentation files (the +** "Software"), to deal in the Software without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Software, and to +** permit persons to whom the Software is furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +** +** [ MIT license: http://www.opensource.org/licenses/mit-license.php ] +*/ + +#ifndef MRUBY_H +#define MRUBY_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include <stdlib.h> +#include "mrbconf.h" + +#include "mruby/value.h" + +typedef int32_t mrb_code; + +struct mrb_state; + +typedef void* (*mrb_allocf) (struct mrb_state *mrb, void*, size_t, void *ud); + +#ifndef MRB_ARENA_SIZE +#define MRB_ARENA_SIZE 100 +#endif + +typedef struct { + mrb_sym mid; + struct RProc *proc; + int stackidx; + int nregs; + int argc; + mrb_code *pc; + int acc; + struct RClass *target_class; + int ridx; + int eidx; + struct REnv *env; +} mrb_callinfo; + +enum gc_state { + GC_STATE_NONE = 0, + GC_STATE_MARK, + GC_STATE_SWEEP +}; + +typedef struct mrb_state { + void *jmp; + + mrb_allocf allocf; + + mrb_value *stack; + mrb_value *stbase, *stend; + + mrb_callinfo *ci; + mrb_callinfo *cibase, *ciend; + + mrb_code **rescue; + int rsize; + struct RProc **ensure; + int esize; + + struct RObject *exc; + struct iv_tbl *globals; + + struct mrb_irep **irep; + size_t irep_len, irep_capa; + + mrb_sym init_sym; + struct RClass *object_class; + struct RClass *class_class; + struct RClass *module_class; + struct RClass *proc_class; + struct RClass *string_class; + struct RClass *array_class; + struct RClass *hash_class; + + struct RClass *float_class; + struct RClass *fixnum_class; + struct RClass *true_class; + struct RClass *false_class; + struct RClass *nil_class; + struct RClass *symbol_class; + struct RClass *kernel_module; + + struct heap_page *heaps; + struct heap_page *sweeps; + struct heap_page *free_heaps; + size_t live; /* count of live objects */ + struct RBasic *arena[MRB_ARENA_SIZE]; + int arena_idx; + + enum gc_state gc_state; /* state of gc */ + int current_white_part; /* make white object by white_part */ + struct RBasic *gray_list; /* list of gray objects */ + struct RBasic *variable_gray_list; /* list of objects to be traversed atomically */ + size_t gc_live_after_mark; + size_t gc_threshold; + int gc_interval_ratio; + int gc_step_ratio; + unsigned int gc_disabled:1; + unsigned int gc_full:1; + unsigned int is_generational_gc_mode:1; + size_t majorgc_old_threshold; + struct alloca_header *mems; + + mrb_sym symidx; + struct kh_n2s *name2sym; /* symbol table */ +#ifdef INCLUDE_REGEXP + struct RNode *local_svar;/* regexp */ +#endif + + struct RClass *eException_class; + struct RClass *eStandardError_class; + + void *ud; /* auxiliary data */ +} mrb_state; + +typedef mrb_value (*mrb_func_t)(mrb_state *mrb, mrb_value); +typedef mrb_value (*mrb_funcargv_t)(mrb_state *mrb, mrb_value, int argc, mrb_value* argv); +struct RClass *mrb_define_class(mrb_state *, const char*, struct RClass*); +struct RClass *mrb_define_module(mrb_state *, const char*); +mrb_value mrb_singleton_class(mrb_state*, mrb_value); +void mrb_include_module(mrb_state*, struct RClass*, struct RClass*); + +void mrb_define_method(mrb_state*, struct RClass*, const char*, mrb_func_t,int); +void mrb_define_class_method(mrb_state *, struct RClass *, const char *, mrb_func_t, int); +void mrb_define_singleton_method(mrb_state*, struct RObject*, const char*, mrb_func_t,int); +void mrb_define_module_function(mrb_state*, struct RClass*, const char*, mrb_func_t,int); +void mrb_define_const(mrb_state*, struct RClass*, const char *name, mrb_value); +void mrb_undef_method(mrb_state*, struct RClass*, const char*); +void mrb_undef_class_method(mrb_state*, struct RClass*, const char*); +mrb_value mrb_instance_new(mrb_state *mrb, mrb_value cv); +struct RClass * mrb_class_new(mrb_state *mrb, struct RClass *super); +struct RClass * mrb_module_new(mrb_state *mrb); +struct RClass * mrb_class_get(mrb_state *mrb, const char *name); +struct RClass * mrb_class_obj_get(mrb_state *mrb, const char *name); + +mrb_value mrb_obj_dup(mrb_state *mrb, mrb_value obj); +mrb_value mrb_check_to_integer(mrb_state *mrb, mrb_value val, const char *method); +int mrb_obj_respond_to(struct RClass* c, mrb_sym mid); +struct RClass * mrb_define_class_under(mrb_state *mrb, struct RClass *outer, const char *name, struct RClass *super); +struct RClass * mrb_define_module_under(mrb_state *mrb, struct RClass *outer, const char *name); + +/* required arguments */ +#define ARGS_REQ(n) (((n)&0x1f) << 19) +/* optional arguments */ +#define ARGS_OPT(n) (((n)&0x1f) << 14) +/* rest argument */ +#define ARGS_REST() (1 << 13) +/* required arguments after rest */ +#define ARGS_POST(n) (((n)&0x1f) << 8) +/* keyword arguments (n of keys, kdict) */ +#define ARGS_KEY(n1,n2) ((((n1)&0x1f) << 3) | ((n2)?(1<<2):0)) +/* block argument */ +#define ARGS_BLOCK() (1 << 1) + +/* accept any number of arguments */ +#define ARGS_ANY() ARGS_REST() +/* accept no arguments */ +#define ARGS_NONE() 0 + +int mrb_get_args(mrb_state *mrb, const char *format, ...); + +mrb_value mrb_funcall(mrb_state*, mrb_value, const char*, int,...); +mrb_value mrb_funcall_argv(mrb_state*, mrb_value, mrb_sym, int, mrb_value*); +mrb_value mrb_funcall_with_block(mrb_state*, mrb_value, mrb_sym, int, mrb_value*, mrb_value); +mrb_sym mrb_intern(mrb_state*,const char*); +mrb_sym mrb_intern2(mrb_state*,const char*,int); +mrb_sym mrb_intern_str(mrb_state*,mrb_value); +const char *mrb_sym2name(mrb_state*,mrb_sym); +const char *mrb_sym2name_len(mrb_state*,mrb_sym,int*); +mrb_value mrb_str_format(mrb_state *, int, const mrb_value *, mrb_value); + +void *mrb_malloc(mrb_state*, size_t); +void *mrb_calloc(mrb_state*, size_t, size_t); +void *mrb_realloc(mrb_state*, void*, size_t); +struct RBasic *mrb_obj_alloc(mrb_state*, enum mrb_vtype, struct RClass*); +void *mrb_free(mrb_state*, void*); + +mrb_value mrb_str_new(mrb_state *mrb, const char *p, int len); /* mrb_str_new */ +mrb_value mrb_str_new_cstr(mrb_state*, const char*); +mrb_value mrb_str_new2(mrb_state *mrb, const char *p); + +mrb_state* mrb_open(void); +mrb_state* mrb_open_allocf(mrb_allocf, void *ud); +void mrb_close(mrb_state*); +int mrb_checkstack(mrb_state*,int); + +mrb_value mrb_top_self(mrb_state *); +mrb_value mrb_run(mrb_state*, struct RProc*, mrb_value); + +void mrb_p(mrb_state*, mrb_value); +mrb_int mrb_obj_id(mrb_value obj); +mrb_sym mrb_to_id(mrb_state *mrb, mrb_value name); + +int mrb_obj_eq(mrb_state*, mrb_value, mrb_value); +int mrb_obj_equal(mrb_state*, mrb_value, mrb_value); +int mrb_equal(mrb_state *mrb, mrb_value obj1, mrb_value obj2); +mrb_value mrb_Integer(mrb_state *mrb, mrb_value val); +mrb_value mrb_Float(mrb_state *mrb, mrb_value val); +mrb_value mrb_inspect(mrb_state *mrb, mrb_value obj); +int mrb_eql(mrb_state *mrb, mrb_value obj1, mrb_value obj2); + +void mrb_garbage_collect(mrb_state*); +void mrb_incremental_gc(mrb_state *); +int mrb_gc_arena_save(mrb_state*); +void mrb_gc_arena_restore(mrb_state*,int); +void mrb_gc_mark(mrb_state*,struct RBasic*); +#define mrb_gc_mark_value(mrb,val) do {\ + if (mrb_type(val) >= MRB_TT_OBJECT) mrb_gc_mark((mrb), mrb_object(val));\ +} while (0); +void mrb_field_write_barrier(mrb_state *, struct RBasic*, struct RBasic*); +#define mrb_field_write_barrier_value(mrb, obj, val) do{\ + if ((val.tt >= MRB_TT_OBJECT)) mrb_field_write_barrier((mrb), (obj), mrb_object(val));\ +} while (0); +void mrb_write_barrier(mrb_state *, struct RBasic*); + +mrb_value mrb_check_convert_type(mrb_state *mrb, mrb_value val, mrb_int type, const char *tname, const char *method); +mrb_value mrb_any_to_s(mrb_state *mrb, mrb_value obj); +const char * mrb_obj_classname(mrb_state *mrb, mrb_value obj); +struct RClass* mrb_obj_class(mrb_state *mrb, mrb_value obj); +mrb_value mrb_class_path(mrb_state *mrb, struct RClass *c); +mrb_value mrb_convert_type(mrb_state *mrb, mrb_value val, mrb_int type, const char *tname, const char *method); +int mrb_obj_is_kind_of(mrb_state *mrb, mrb_value obj, struct RClass *c); +mrb_value mrb_obj_inspect(mrb_state *mrb, mrb_value self); +mrb_value mrb_obj_clone(mrb_state *mrb, mrb_value self); +mrb_value mrb_check_funcall(mrb_state *mrb, mrb_value recv, mrb_sym mid, int argc, mrb_value *argv); + +/* need to include <ctype.h> to use these macros */ +#ifndef ISPRINT +//#define ISASCII(c) isascii((int)(unsigned char)(c)) +#define ISASCII(c) 1 +#undef ISPRINT +#define ISPRINT(c) (ISASCII(c) && isprint((int)(unsigned char)(c))) +#define ISSPACE(c) (ISASCII(c) && isspace((int)(unsigned char)(c))) +#define ISUPPER(c) (ISASCII(c) && isupper((int)(unsigned char)(c))) +#define ISLOWER(c) (ISASCII(c) && islower((int)(unsigned char)(c))) +#define ISALNUM(c) (ISASCII(c) && isalnum((int)(unsigned char)(c))) +#define ISALPHA(c) (ISASCII(c) && isalpha((int)(unsigned char)(c))) +#define ISDIGIT(c) (ISASCII(c) && isdigit((int)(unsigned char)(c))) +#define ISXDIGIT(c) (ISASCII(c) && isxdigit((int)(unsigned char)(c))) +#define TOUPPER(c) (ISASCII(c) ? toupper((int)(unsigned char)(c)) : (c)) +#define TOLOWER(c) (ISASCII(c) ? tolower((int)(unsigned char)(c)) : (c)) +#endif + +mrb_value mrb_exc_new(mrb_state *mrb, struct RClass *c, const char *ptr, long len); +void mrb_exc_raise(mrb_state *mrb, mrb_value exc); + +int mrb_block_given_p(void); +void mrb_raise(mrb_state *mrb, struct RClass *c, const char *msg); +void mrb_raisef(mrb_state *mrb, struct RClass *c, const char *fmt, ...); +void mrb_warn(const char *fmt, ...); +void mrb_bug(const char *fmt, ...); + +#define E_RUNTIME_ERROR (mrb_class_obj_get(mrb, "RuntimeError")) +#define E_TYPE_ERROR (mrb_class_obj_get(mrb, "TypeError")) +#define E_ARGUMENT_ERROR (mrb_class_obj_get(mrb, "ArgumentError")) +#define E_INDEX_ERROR (mrb_class_obj_get(mrb, "IndexError")) +#define E_RANGE_ERROR (mrb_class_obj_get(mrb, "RangeError")) +#define E_NAME_ERROR (mrb_class_obj_get(mrb, "NameError")) +#define E_NOMETHOD_ERROR (mrb_class_obj_get(mrb, "NoMethodError")) +#define E_SCRIPT_ERROR (mrb_class_obj_get(mrb, "ScriptError")) +#define E_SYNTAX_ERROR (mrb_class_obj_get(mrb, "SyntaxError")) +#define E_LOCALJUMP_ERROR (mrb_class_obj_get(mrb, "LocalJumpError")) +#define E_REGEXP_ERROR (mrb_class_obj_get(mrb, "RegexpError")) + +#define E_NOTIMP_ERROR (mrb_class_obj_get(mrb, "NotImplementedError")) +#define E_FLOATDOMAIN_ERROR (mrb_class_obj_get(mrb, "FloatDomainError")) + +#define E_KEY_ERROR (mrb_class_obj_get(mrb, "KeyError")) + +mrb_value mrb_yield(mrb_state *mrb, mrb_value v, mrb_value blk); +mrb_value mrb_yield_argv(mrb_state *mrb, mrb_value b, int argc, mrb_value *argv); +mrb_value mrb_class_new_instance(mrb_state *mrb, int, mrb_value*, struct RClass *); +mrb_value mrb_class_new_instance_m(mrb_state *mrb, mrb_value klass); + +void mrb_gc_protect(mrb_state *mrb, mrb_value obj); +mrb_value mrb_to_int(mrb_state *mrb, mrb_value val); +void mrb_check_type(mrb_state *mrb, mrb_value x, enum mrb_vtype t); + +typedef enum call_type { + CALL_PUBLIC, + CALL_FCALL, + CALL_VCALL, + CALL_TYPE_MAX +} call_type; + +/* compar.c */ +void mrb_cmperr(mrb_state *mrb, mrb_value x, mrb_value y); +int mrb_cmpint(mrb_state *mrb, mrb_value val, mrb_value a, mrb_value b); + +#ifndef ANYARGS +# ifdef __cplusplus +# define ANYARGS ... +# else +# define ANYARGS +# endif +#endif +void mrb_define_alias(mrb_state *mrb, struct RClass *klass, const char *name1, const char *name2); +const char *mrb_class_name(mrb_state *mrb, struct RClass* klass); +void mrb_define_global_const(mrb_state *mrb, const char *name, mrb_value val); + +mrb_value mrb_block_proc(void); +mrb_value mrb_attr_get(mrb_state *mrb, mrb_value obj, mrb_sym id); + +int mrb_respond_to(mrb_state *mrb, mrb_value obj, mrb_sym mid); +int mrb_obj_is_instance_of(mrb_state *mrb, mrb_value obj, struct RClass* c); + +/* memory pool implementation */ +typedef struct mrb_pool mrb_pool; +struct mrb_pool* mrb_pool_open(mrb_state*); +void mrb_pool_close(struct mrb_pool*); +void* mrb_pool_alloc(struct mrb_pool*, size_t); +void* mrb_pool_realloc(struct mrb_pool*, void*, size_t oldlen, size_t newlen); +int mrb_pool_can_realloc(struct mrb_pool*, void*, size_t); +void* mrb_alloca(mrb_state *mrb, size_t); + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* MRUBY_H */ Added: vendor/mruby-b5830ae/include/mruby/array.h (+64 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby/array.h 2013-01-09 13:19:18 +0900 (c5959bb) @@ -0,0 +1,64 @@ +/* +** mruby/array.h - Array class +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBY_ARRAY_H +#define MRUBY_ARRAY_H + +#if defined(__cplusplus) +extern "C" { +#endif + +struct mrb_shared_array { + int refcnt; + mrb_value *ptr; + int len; +}; + +struct RArray { + MRB_OBJECT_HEADER; + int len; + union { + int capa; + struct mrb_shared_array *shared; + } aux; + mrb_value *ptr; +}; + +#define mrb_ary_ptr(v) ((struct RArray*)((v).value.p)) +#define mrb_ary_value(p) mrb_obj_value((void*)(p)) +#define RARRAY(v) ((struct RArray*)((v).value.p)) + +#define RARRAY_LEN(a) (RARRAY(a)->len) +#define RARRAY_PTR(a) (RARRAY(a)->ptr) +#define MRB_ARY_SHARED 256 + +void mrb_ary_decref(mrb_state*, struct mrb_shared_array*); +mrb_value mrb_ary_new_capa(mrb_state*, int); +mrb_value mrb_ary_new(mrb_state *mrb); +mrb_value mrb_ary_new_elts(mrb_state *mrb, int n, const mrb_value *elts); +void mrb_ary_concat(mrb_state*, mrb_value, mrb_value); +mrb_value mrb_ary_splat(mrb_state*, mrb_value); +void mrb_ary_push(mrb_state*, mrb_value, mrb_value); +mrb_value mrb_ary_pop(mrb_state *mrb, mrb_value ary); +mrb_value mrb_ary_new_from_values(mrb_state *mrb, int size, mrb_value *vals); +mrb_value mrb_ary_aget(mrb_state *mrb, mrb_value self); +mrb_value mrb_ary_ref(mrb_state *mrb, mrb_value ary, mrb_int n); +void mrb_ary_set(mrb_state *mrb, mrb_value ary, mrb_int n, mrb_value val); +int mrb_ary_len(mrb_state *mrb, mrb_value ary); +void mrb_ary_replace(mrb_state *mrb, mrb_value a, mrb_value b); +mrb_value mrb_check_array_type(mrb_state *mrb, mrb_value self); +mrb_value mrb_ary_unshift(mrb_state *mrb, mrb_value self, mrb_value item); +mrb_value mrb_ary_new4(mrb_state *mrb, int n, const mrb_value *elts); +mrb_value mrb_assoc_new(mrb_state *mrb, mrb_value car, mrb_value cdr); +mrb_value mrb_ary_entry(mrb_value ary, int offset); +mrb_value mrb_ary_shift(mrb_state *mrb, mrb_value self); +mrb_value mrb_ary_clear(mrb_state *mrb, mrb_value self); + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* MRUBY_ARRAY_H */ Added: vendor/mruby-b5830ae/include/mruby/cdump.h (+31 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby/cdump.h 2013-01-09 13:19:18 +0900 (6afbb98) @@ -0,0 +1,31 @@ +/* +** mruby/cdump.h - mruby binary dumper (C source format) +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBY_CDUMP_H +#define MRUBY_CDUMP_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include "mruby.h" +#ifdef DISABLE_STDIO +# error "Configuration conflict. Can't use with DISABLE_STDIO option." +#else +# include <stdio.h> +#endif + +int mrb_cdump_irep(mrb_state *mrb, int n, FILE *f,const char *initname); + +/* error code */ +#define MRB_CDUMP_OK 0 +#define MRB_CDUMP_GENERAL_FAILURE -1 + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* MRUBY_CDUMP_H */ Added: vendor/mruby-b5830ae/include/mruby/class.h (+85 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby/class.h 2013-01-09 13:19:18 +0900 (eda54df) @@ -0,0 +1,85 @@ +/* +** mruby/class.h - Class class +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBY_CLASS_H +#define MRUBY_CLASS_H + +#if defined(__cplusplus) +extern "C" { +#endif + +struct RClass { + MRB_OBJECT_HEADER; + struct iv_tbl *iv; + struct kh_mt *mt; + struct RClass *super; +}; + +#define mrb_class_ptr(v) ((struct RClass*)((v).value.p)) +#define RCLASS_SUPER(v) (((struct RClass*)((v).value.p))->super) +#define RCLASS_IV_TBL(v) (((struct RClass*)((v).value.p))->iv) +#define RCLASS_M_TBL(v) (((struct RClass*)((v).value.p))->mt) + +static inline struct RClass* +mrb_class(mrb_state *mrb, mrb_value v) +{ + switch (mrb_type(v)) { + case MRB_TT_FALSE: + if (v.value.i) + return mrb->false_class; + return mrb->nil_class; + case MRB_TT_TRUE: + return mrb->true_class; + case MRB_TT_SYMBOL: + return mrb->symbol_class; + case MRB_TT_FIXNUM: + return mrb->fixnum_class; + case MRB_TT_FLOAT: + return mrb->float_class; + case MRB_TT_MAIN: + return mrb->object_class; + +#ifdef ENABLE_REGEXP + case MRB_TT_REGEX: + case MRB_TT_MATCH: + mrb_raise(mrb, E_TYPE_ERROR, "type mismatch: %s given", + mrb_obj_classname(mrb, v)); + return mrb->nil_class; /* not reach */ +#endif + default: + return mrb_object(v)->c; + } +} + +#define MRB_SET_INSTANCE_TT(c, tt) c->flags = ((c->flags & ~0xff) | (char)tt) +#define MRB_INSTANCE_TT(c) (enum mrb_vtype)(c->flags & 0xff) + +struct RClass* mrb_define_class_id(mrb_state*, mrb_sym, struct RClass*); +struct RClass* mrb_define_module_id(mrb_state*, mrb_sym); +struct RClass *mrb_vm_define_class(mrb_state*, mrb_value, mrb_value, mrb_sym); +struct RClass *mrb_vm_define_module(mrb_state*, mrb_value, mrb_sym); +void mrb_define_method_vm(mrb_state*, struct RClass*, mrb_sym, mrb_value); +void mrb_define_method_raw(mrb_state*, struct RClass*, mrb_sym, struct RProc *); +void mrb_define_method_id(mrb_state *mrb, struct RClass *c, mrb_sym mid, mrb_func_t func, int aspec); +void mrb_alias_method(mrb_state *mrb, struct RClass *c, mrb_sym a, mrb_sym b); + +struct RClass *mrb_class_outer_module(mrb_state*, struct RClass *); +struct RProc *mrb_method_search_vm(mrb_state*, struct RClass**, mrb_sym); +struct RProc *mrb_method_search(mrb_state*, struct RClass*, mrb_sym); + +struct RClass* mrb_class_real(struct RClass* cl); + +void mrb_obj_call_init(mrb_state *mrb, mrb_value obj, int argc, mrb_value *argv); + +void mrb_gc_mark_mt(mrb_state*, struct RClass*); +size_t mrb_gc_mark_mt_size(mrb_state*, struct RClass*); +void mrb_gc_free_mt(mrb_state*, struct RClass*); + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* MRUBY_CLASS_H */ Added: vendor/mruby-b5830ae/include/mruby/compile.h (+125 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby/compile.h 2013-01-09 13:19:18 +0900 (e035b9e) @@ -0,0 +1,125 @@ +/* +** mruby/compile.h - mruby parser +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBY_COMPILE_H +#define MRUBY_COMPILE_H 1 + +#if defined(__cplusplus) +extern "C" { +#endif + +#include "mruby.h" +#include <stdio.h> +#include <setjmp.h> + +/* load context */ +typedef struct mrbc_context { + mrb_sym *syms; + int slen; + char *filename; + short lineno; + int capture_errors:1; + int dump_result:1; + int no_exec:1; +} mrbc_context; + +mrbc_context* mrbc_context_new(mrb_state *mrb); +void mrbc_context_free(mrb_state *mrb, mrbc_context *cxt); +const char *mrbc_filename(mrb_state *mrb, mrbc_context *c, const char *s); + +/* AST node structure */ +typedef struct mrb_ast_node { + struct mrb_ast_node *car, *cdr; + short lineno; +} mrb_ast_node; + +/* lexer states */ +enum mrb_lex_state_enum { + EXPR_BEG, /* ignore newline, +/- is a sign. */ + EXPR_END, /* newline significant, +/- is an operator. */ + EXPR_ENDARG, /* ditto, and unbound braces. */ + EXPR_ENDFN, /* ditto, and unbound braces. */ + EXPR_ARG, /* newline significant, +/- is an operator. */ + EXPR_CMDARG, /* newline significant, +/- is an operator. */ + EXPR_MID, /* newline significant, +/- is an operator. */ + EXPR_FNAME, /* ignore newline, no reserved words. */ + EXPR_DOT, /* right after `.' or `::', no reserved words. */ + EXPR_CLASS, /* immediate after `class', no here document. */ + EXPR_VALUE, /* alike EXPR_BEG but label is disallowed. */ + EXPR_MAX_STATE +}; + +/* saved error message */ +struct mrb_parser_message { + int lineno; + int column; + char* message; +}; + +/* parser structure */ +struct mrb_parser_state { + mrb_state *mrb; + struct mrb_pool *pool; + mrb_ast_node *cells; + const char *s, *send; + FILE *f; + char *filename; + int lineno; + int column; + + enum mrb_lex_state_enum lstate; + int sterm; + + unsigned int cond_stack; + unsigned int cmdarg_stack; + int paren_nest; + int lpar_beg; + int in_def, in_single, cmd_start; + mrb_ast_node *locals; + + mrb_ast_node *pb; + char buf[1024]; + int bidx; + + mrb_ast_node *heredoc; + + void *ylval; + + int nerr; + int nwarn; + mrb_ast_node *tree; + + int capture_errors; + struct mrb_parser_message error_buffer[10]; + struct mrb_parser_message warn_buffer[10]; + + jmp_buf jmp; +}; + +struct mrb_parser_state* mrb_parser_new(mrb_state*); +void mrb_parser_free(struct mrb_parser_state*); +const char *mrb_parser_filename(struct mrb_parser_state*, const char*); +void mrb_parser_parse(struct mrb_parser_state*,mrbc_context*); + +/* utility functions */ +struct mrb_parser_state* mrb_parse_file(mrb_state*,FILE*,mrbc_context*); +struct mrb_parser_state* mrb_parse_string(mrb_state*,const char*,mrbc_context*); +struct mrb_parser_state* mrb_parse_nstring(mrb_state*,const char*,int,mrbc_context*); +int mrb_generate_code(mrb_state*, struct mrb_parser_state*); + +/* program load functions */ +mrb_value mrb_load_file(mrb_state*,FILE*); +mrb_value mrb_load_string(mrb_state *mrb, const char *s); +mrb_value mrb_load_nstring(mrb_state *mrb, const char *s, int len); +mrb_value mrb_load_file_cxt(mrb_state*,FILE*, mrbc_context *cxt); +mrb_value mrb_load_string_cxt(mrb_state *mrb, const char *s, mrbc_context *cxt); +mrb_value mrb_load_nstring_cxt(mrb_state *mrb, const char *s, int len, mrbc_context *cxt); + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* MRUBY_COMPILE_H */ Added: vendor/mruby-b5830ae/include/mruby/data.h (+50 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby/data.h 2013-01-09 13:19:18 +0900 (b9bedb3) @@ -0,0 +1,50 @@ +/* +** mruby/data.h - Data class +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBY_DATA_H +#define MRUBY_DATA_H 1 + +#if defined(__cplusplus) +extern "C" { +#endif + +struct mrb_data_type { + const char *struct_name; + void (*dfree)(mrb_state *mrb, void*); +}; + +struct RData { + MRB_OBJECT_HEADER; + struct iv_tbl *iv; + struct mrb_data_type *type; + void *data; +}; + +struct RData *mrb_data_object_alloc(mrb_state *mrb, struct RClass* klass, void *datap, const struct mrb_data_type *type); + +#define Data_Wrap_Struct(mrb,klass,type,ptr)\ + mrb_data_object_alloc(mrb,klass,ptr,type) + +#define Data_Make_Struct(mrb,klass,strct,type,sval) (\ + sval = mrb_malloc(mrb, sizeof(strct)),\ + { static const strct zero = { 0 }; *sval = zero},\ + Data_Wrap_Struct(mrb,klass,type,sval)\ +) + +#define RDATA(obj) ((struct RData *)((obj).value.p)) +#define DATA_PTR(d) (RDATA(d)->data) +#define DATA_TYPE(d) (RDATA(d)->type) +void *mrb_get_datatype(mrb_state *mrb, mrb_value, const struct mrb_data_type*); +void *mrb_check_datatype(mrb_state *mrb, mrb_value, const struct mrb_data_type*); +#define Data_Get_Struct(mrb,obj,type,sval) do {\ + sval = mrb_check_datatype(mrb, obj, type); \ +} while (0) + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* MRUBY_DATA_H */ Added: vendor/mruby-b5830ae/include/mruby/dump.h (+139 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby/dump.h 2013-01-09 13:19:18 +0900 (1af24ab) @@ -0,0 +1,139 @@ +/* +** mruby/dump.h - mruby binary dumper (Rite binary format) +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBY_DUMP_H +#define MRUBY_DUMP_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include "mruby.h" +#include <stdio.h> +#include <stdint.h> + +int mrb_dump_irep(mrb_state*,int,FILE*); +int mrb_read_irep(mrb_state*,const char*); +int mrb_read_irep_file(mrb_state*,FILE*); +/* mrb_value mrb_load_irep(mrb_state*,const char*); */ /* declared in <irep.h> */ +mrb_value mrb_load_irep_file(mrb_state*,FILE*); + +int mrb_bdump_irep(mrb_state *mrb, int n, FILE *f,const char *initname); + +/* dump type */ +#define DUMP_TYPE_CODE 0 +#define DUMP_TYPE_BIN 1 +#define DUMP_TYPE_HEX 2 + +/* dump/load error code */ +#define MRB_DUMP_OK 0 +#define MRB_DUMP_GENERAL_FAILURE -1 +#define MRB_DUMP_WRITE_FAULT -2 +#define MRB_DUMP_READ_FAULT -3 +#define MRB_DUMP_CRC_ERROR -4 +#define MRB_DUMP_INVALID_FILE_HEADER -5 +#define MRB_DUMP_INVALID_IREP -6 +#define MRB_DUMP_INVALID_ARGUMENT -7 + +/* size of long/int/short value on dump/load */ +#define MRB_DUMP_SIZE_OF_LONG 4 +#define MRB_DUMP_SIZE_OF_INT 4 +#define MRB_DUMP_SIZE_OF_SHORT 2 +#define MRB_DUMP_SIZE_OF_CHAR 1 + +/* null symbol length */ +#define MRB_DUMP_NULL_SYM_LEN 0xFFFF + +/* Use HEX format string */ +#define RITE_FILE_IS_HEX + +#ifdef RITE_FILE_IS_HEX +#define RITE_FILE_HEX_SIZE 2 +#else +#define RITE_FILE_HEX_SIZE 1 +#endif + +/* Rite Binary File header */ +#define RITE_FILE_IDENFIFIER "RITE" +#define RITE_FILE_FORMAT_VER "00090000" +#define RITE_VM_VER "00090000" +#define RITE_COMPILER_TYPE "MATZ " +#define RITE_COMPILER_VER "00090000" +#define RITE_RESERVED " " + +/* irep header */ +#define RITE_IREP_IDENFIFIER 'S' +#define RITE_IREP_TYPE_CLASS 'C' +#define RITE_IREP_TYPE_MODULE 'M' + +#define MRB_DUMP_DEFAULT_STR_LEN 128 + +//Rite Binary file_header +typedef struct _rite_binary_header { + unsigned char rbfi[4]; //Rite Binary File Identify + unsigned char rbfv[8]; //Rite Binary File Format Version + unsigned char risv[8]; //Rite Instruction Specification Version + unsigned char rct[8]; //Rite Compiler Type + unsigned char rcv[8]; //Rite Compiler Version + unsigned char rbds[4]; //Rite Binary Data Size + unsigned char nirep[2]; //Number of ireps + unsigned char sirep[2]; //Start index + unsigned char rsv[8]; //Reserved +} rite_binary_header; + +// Rite File file_header +typedef struct _rite_file_header { + unsigned char rbfi[4]; //Rite Binary File Identify + unsigned char rbfv[8]; //Rite Binary File Format Version + unsigned char risv[8]; //Rite Instruction Specification Version + unsigned char rct[8]; //Rite Compiler Type + unsigned char rcv[8]; //Rite Compiler Version + unsigned char rbds[8]; //Rite Binary Data Size + unsigned char nirep[4]; //Number of ireps + unsigned char sirep[4]; //Start index + unsigned char rsv[8]; //Reserved + unsigned char hcrc[4]; //HCRC +} rite_file_header; + +static inline int +uint16_to_bin(uint16_t s, char *bin) +{ + *bin++ = (s >> 8) & 0xff; + *bin = s & 0xff; + return (MRB_DUMP_SIZE_OF_SHORT); +} + +static inline int +uint32_to_bin(uint32_t l, char *bin) +{ + *bin++ = (l >> 24) & 0xff; + *bin++ = (l >> 16) & 0xff; + *bin++ = (l >> 8) & 0xff; + *bin = l & 0xff; + return (MRB_DUMP_SIZE_OF_LONG); +} + +static inline uint32_t +bin_to_uint32(unsigned char bin[]) +{ + return (uint32_t)bin[0] << 24 | + (uint32_t)bin[1] << 16 | + (uint32_t)bin[2] << 8 | + (uint32_t)bin[3]; +} + +static inline uint16_t +bin_to_uint16(unsigned char bin[]) +{ + return (uint16_t)bin[0] << 8 | + (uint16_t)bin[1]; +} + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* MRUBY_DUMP_H */ Added: vendor/mruby-b5830ae/include/mruby/hash.h (+54 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby/hash.h 2013-01-09 13:19:18 +0900 (bb12962) @@ -0,0 +1,54 @@ +/* +** mruby/hash.h - Hash class +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBY_HASH_H +#define MRUBY_HASH_H + +#if defined(__cplusplus) +extern "C" { +#endif + +struct RHash { + MRB_OBJECT_HEADER; + struct iv_tbl *iv; + struct kh_ht *ht; +}; + +#define mrb_hash_ptr(v) ((struct RHash*)((v).value.p)) +#define mrb_hash_value(p) mrb_obj_value((void*)(p)) + +mrb_value mrb_hash_new_capa(mrb_state*, int); +mrb_value mrb_hash_new(mrb_state *mrb); + +void mrb_hash_set(mrb_state *mrb, mrb_value hash, mrb_value key, mrb_value val); +mrb_value mrb_hash_get(mrb_state *mrb, mrb_value hash, mrb_value key); +mrb_value mrb_hash_fetch(mrb_state *mrb, mrb_value hash, mrb_value key, mrb_value def); +mrb_value mrb_hash_delete_key(mrb_state *mrb, mrb_value hash, mrb_value key); +mrb_value mrb_hash(mrb_state *mrb, mrb_value obj); +mrb_value mrb_hash_keys(mrb_state *mrb, mrb_value hash); + +/* RHASH_TBL allocates st_table if not available. */ +#define RHASH(obj) ((struct RHash*)((obj).value.p)) +#define RHASH_TBL(h) (RHASH(h)->ht) +#define RHASH_IFNONE(h) mrb_iv_get(mrb, (h), mrb_intern(mrb, "ifnone")) +#define RHASH_PROCDEFAULT(h) RHASH_IFNONE(h) +struct kh_ht * mrb_hash_tbl(mrb_state *mrb, mrb_value hash); + +#define MRB_HASH_PROC_DEFAULT 256 +#define MRB_RHASH_PROCDEFAULT_P(h) (RHASH(h)->flags & MRB_HASH_PROC_DEFAULT) + +mrb_value mrb_obj_is_proc(mrb_value proc); + +/* GC functions */ +void mrb_gc_mark_ht(mrb_state*, struct RHash*); +size_t mrb_gc_mark_ht_size(mrb_state*, struct RHash*); +void mrb_gc_free_ht(mrb_state*, struct RHash*); + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* MRUBY_HASH_H */ Added: vendor/mruby-b5830ae/include/mruby/irep.h (+40 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby/irep.h 2013-01-09 13:19:18 +0900 (100afb4) @@ -0,0 +1,40 @@ +/* +** mruby/irep.h - mrb_irep structure +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBY_IREP_H +#define MRUBY_IREP_H + +#if defined(__cplusplus) +extern "C" { +#endif + +typedef struct mrb_irep { + int idx:16; + int nlocals:16; + int nregs:16; + int flags:8; + + mrb_code *iseq; + mrb_value *pool; + mrb_sym *syms; + + /* debug info */ + const char *filename; + short *lines; + + int ilen, plen, slen; +} mrb_irep; + +#define MRB_ISEQ_NO_FREE 1 + +mrb_irep *mrb_add_irep(mrb_state *mrb); +mrb_value mrb_load_irep(mrb_state*,const char*); + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* MRUBY_IREP_H */ Added: vendor/mruby-b5830ae/include/mruby/khash.h (+254 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby/khash.h 2013-01-09 13:19:18 +0900 (ad03b1f) @@ -0,0 +1,254 @@ +/* +** mruby/khash.c - Hash for mruby +** +** See Copyright Notice in mruby.h +*/ + +#ifndef KHASH_H +#define KHASH_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include <stdint.h> +#include <string.h> + +typedef uint32_t khint_t; +typedef khint_t khiter_t; + +#ifndef KHASH_DEFAULT_SIZE +# define KHASH_DEFAULT_SIZE 32 +#endif +#define KHASH_MIN_SIZE 8 + +#define UPPER_BOUND(x) ((x)>>2|(x>>1)) + +//extern uint8_t __m[]; + +/* mask for flags */ +static const uint8_t __m[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}; + + +#define __ac_isempty(e_flag, d_flag, i) (e_flag[(i)/8]&__m[(i)%8]) +#define __ac_isdel(e_flag, d_flag, i) (d_flag[(i)/8]&__m[(i)%8]) +#define __ac_iseither(e_flag, d_flag, i) (__ac_isempty(e_flag,d_flag,i)||__ac_isdel(e_flag,d_flag,i)) +#define khash_power2(v) do { \ + v--;\ + v |= v >> 1;\ + v |= v >> 2;\ + v |= v >> 4;\ + v |= v >> 8;\ + v |= v >> 16;\ + v++;\ +} while (0); + +/* declare struct kh_xxx and kh_xxx_funcs + + name: ash name + khkey_t: key data type + khval_t: value data type + kh_is_map: (not implemented / not used in RiteVM) +*/ +#define KHASH_DECLARE(name, khkey_t, khval_t, kh_is_map) \ + typedef struct kh_##name { \ + khint_t n_buckets; \ + khint_t size; \ + khint_t n_occupied; \ + khint_t upper_bound; \ + uint8_t *e_flags; \ + uint8_t *d_flags; \ + khkey_t *keys; \ + khval_t *vals; \ + khint_t mask; \ + khint_t inc; \ + mrb_state *mrb; \ + } kh_##name##_t; \ + void kh_alloc_##name(kh_##name##_t *h); \ + kh_##name##_t *kh_init_##name##_size(mrb_state *mrb, khint_t size); \ + kh_##name##_t *kh_init_##name(mrb_state *mrb); \ + void kh_destroy_##name(kh_##name##_t *h); \ + void kh_clear_##name(kh_##name##_t *h); \ + khint_t kh_get_##name(kh_##name##_t *h, khkey_t key); \ + khint_t kh_put_##name(kh_##name##_t *h, khkey_t key); \ + void kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets); \ + void kh_del_##name(kh_##name##_t *h, khint_t x); \ + kh_##name##_t *kh_copy_##name(mrb_state *mrb, kh_##name##_t *h); + +/* define kh_xxx_funcs + + name: ash name + khkey_t: key data type + khval_t: value data type + kh_is_map: (not implemented / not used in RiteVM) + __hash_func: hash function + __hash_equal: hash comparation function +*/ +#define KHASH_DEFINE(name, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \ + void kh_alloc_##name(kh_##name##_t *h) \ + { \ + khint_t sz = h->n_buckets; \ + h->size = h->n_occupied = 0; \ + h->upper_bound = UPPER_BOUND(sz); \ + h->e_flags = (uint8_t *)mrb_malloc(h->mrb, sizeof(uint8_t)*sz/4); \ + h->d_flags = h->e_flags + sz/8; \ + memset(h->e_flags, 0xff, sz/8*sizeof(uint8_t)); \ + memset(h->d_flags, 0x00, sz/8*sizeof(uint8_t)); \ + h->keys = (khkey_t *)mrb_malloc(h->mrb, sizeof(khkey_t)*sz); \ + h->vals = (khval_t *)mrb_malloc(h->mrb, sizeof(khval_t)*sz); \ + h->mask = sz-1; \ + h->inc = sz/2-1; \ + } \ + kh_##name##_t *kh_init_##name##_size(mrb_state *mrb, khint_t size) { \ + kh_##name##_t *h = (kh_##name##_t*)mrb_calloc(mrb, 1, sizeof(kh_##name##_t)); \ + if (size < KHASH_MIN_SIZE) \ + size = KHASH_MIN_SIZE; \ + khash_power2(size); \ + h->n_buckets = size; \ + h->mrb = mrb; \ + kh_alloc_##name(h); \ + return h; \ + } \ + kh_##name##_t *kh_init_##name(mrb_state *mrb){ \ + return kh_init_##name##_size(mrb, KHASH_DEFAULT_SIZE); \ + } \ + void kh_destroy_##name(kh_##name##_t *h) \ + { \ + if (h) { \ + mrb_free(h->mrb, h->keys); \ + mrb_free(h->mrb, h->vals); \ + mrb_free(h->mrb, h->e_flags); \ + mrb_free(h->mrb, h); \ + } \ + } \ + void kh_clear_##name(kh_##name##_t *h) \ + { \ + if (h && h->e_flags) { \ + memset(h->e_flags, 0xff, h->n_buckets/8*sizeof(uint8_t)); \ + memset(h->d_flags, 0x00, h->n_buckets/8*sizeof(uint8_t)); \ + h->size = h->n_occupied = 0; \ + } \ + } \ + khint_t kh_get_##name(kh_##name##_t *h, khkey_t key) \ + { \ + khint_t k = __hash_func(h->mrb,key) & (h->mask); \ + while (!__ac_isempty(h->e_flags, h->d_flags, k)) { \ + if (!__ac_isdel(h->e_flags, h->d_flags, k)) { \ + if (__hash_equal(h->mrb,h->keys[k], key)) return k; \ + } \ + k = (k+h->inc) & (h->mask); \ + } \ + return h->n_buckets; \ + } \ + void kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets) \ + { \ + if (new_n_buckets < KHASH_MIN_SIZE) \ + new_n_buckets = KHASH_MIN_SIZE; \ + khash_power2(new_n_buckets); \ + { \ + uint8_t *old_e_flags = h->e_flags; \ + khkey_t *old_keys = h->keys; \ + khval_t *old_vals = h->vals; \ + khint_t old_n_buckets = h->n_buckets; \ + khint_t i; \ + h->n_buckets = new_n_buckets; \ + kh_alloc_##name(h); \ + /* relocate */ \ + for (i=0 ; i<old_n_buckets ; i++) { \ + if (!__ac_isempty(old_e_flags, old_d_flags, i)) { \ + khint_t k = kh_put_##name(h, old_keys[i]); \ + kh_value(h,k) = old_vals[i]; \ + } \ + } \ + mrb_free(h->mrb, old_e_flags); \ + mrb_free(h->mrb, old_keys); \ + mrb_free(h->mrb, old_vals); \ + } \ + } \ + khint_t kh_put_##name(kh_##name##_t *h, khkey_t key) \ + { \ + khint_t k; \ + if (h->n_occupied >= h->upper_bound) { \ + kh_resize_##name(h, h->n_buckets*2); \ + } \ + k = __hash_func(h->mrb,key) & (h->mask); \ + while (!__ac_iseither(h->e_flags, h->d_flags, k)) { \ + if (__hash_equal(h->mrb,h->keys[k], key)) break; \ + k = (k+h->inc) & (h->mask); \ + } \ + if (__ac_isempty(h->e_flags, h->d_flags, k)) { \ + /* put at empty */ \ + h->keys[k] = key; \ + h->e_flags[k/8] &= ~__m[k%8]; \ + h->size++; \ + h->n_occupied++; \ + } else if (__ac_isdel(h->e_flags, h->d_flags, k)) { \ + /* put at del */ \ + h->keys[k] = key; \ + h->d_flags[k/8] &= ~__m[k%8]; \ + h->size++; \ + } \ + return k; \ + } \ + void kh_del_##name(kh_##name##_t *h, khint_t x) \ + { \ + h->d_flags[x/8] |= __m[x%8]; \ + h->size--; \ + } \ + kh_##name##_t *kh_copy_##name(mrb_state *mrb, kh_##name##_t *h) \ + { \ + kh_##name##_t *h2; \ + khiter_t k, k2; \ + \ + h2 = kh_init_##name(mrb); \ + for (k = kh_begin(h); k != kh_end(h); k++) { \ + if (kh_exist(h, k)) { \ + k2 = kh_put_##name(h2, kh_key(h, k)); \ + kh_value(h2, k2) = kh_value(h, k); \ + } \ + } \ + return h2; \ + } + + +#define khash_t(name) kh_##name##_t + +#define kh_init_size(name,mrb,size) kh_init_##name##_size(mrb,size) +#define kh_init(name,mrb) kh_init_##name(mrb) +#define kh_destroy(name, h) kh_destroy_##name(h) +#define kh_clear(name, h) kh_clear_##name(h) +#define kh_resize(name, h, s) kh_resize_##name(h, s) +#define kh_put(name, h, k) kh_put_##name(h, k) +#define kh_get(name, h, k) kh_get_##name(h, k) +#define kh_del(name, h, k) kh_del_##name(h, k) +#define kh_copy(name, mrb, h) kh_copy_##name(mrb, h) + +#define kh_exist(h, x) (!__ac_iseither((h)->e_flags, (h)->d_flags, (x))) +#define kh_key(h, x) ((h)->keys[x]) +#define kh_val(h, x) ((h)->vals[x]) +#define kh_value(h, x) ((h)->vals[x]) +#define kh_begin(h) (khint_t)(0) +#define kh_end(h) ((h)->n_buckets) +#define kh_size(h) ((h)->size) +#define kh_n_buckets(h) ((h)->n_buckets) + +#define kh_int_hash_func(mrb,key) (khint_t)((key)^((key)<<2)^((key)>>2)) +#define kh_int_hash_equal(mrb,a, b) (a == b) +#define kh_int64_hash_func(mrb,key) (khint_t)((key)>>33^(key)^(key)<<11) +#define kh_int64_hash_equal(mrb,a, b) (a == b) +static inline khint_t __ac_X31_hash_string(const char *s) +{ + khint_t h = *s; + if (h) for (++s ; *s; ++s) h = (h << 5) - h + *s; + return h; +} +#define kh_str_hash_func(mrb,key) __ac_X31_hash_string(key) +#define kh_str_hash_equal(mrb,a, b) (strcmp(a, b) == 0) + +typedef const char *kh_cstr_t; + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* KHASH_H */ Added: vendor/mruby-b5830ae/include/mruby/numeric.h (+32 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby/numeric.h 2013-01-09 13:19:18 +0900 (9a5ba44) @@ -0,0 +1,32 @@ +/* +** mruby/numeric.h - Numeric, Integer, Float, Fixnum class +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBY_NUMERIC_H +#define MRUBY_NUMERIC_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include <limits.h> + +#define POSFIXABLE(f) ((f) <= MRB_INT_MAX) +#define NEGFIXABLE(f) ((f) >= MRB_INT_MIN) +#define FIXABLE(f) (POSFIXABLE(f) && NEGFIXABLE(f)) + +mrb_value mrb_flt2big(mrb_state *mrb, mrb_float d); +mrb_value mrb_fix2str(mrb_state *mrb, mrb_value x, int base); + +mrb_value mrb_fixnum_plus(mrb_state *mrb, mrb_value x, mrb_value y); +mrb_value mrb_fixnum_minus(mrb_state *mrb, mrb_value x, mrb_value y); +mrb_value mrb_fixnum_mul(mrb_state *mrb, mrb_value x, mrb_value y); +mrb_value mrb_num_div(mrb_state *mrb, mrb_value x, mrb_value y); + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* MRUBY_NUMERIC_H */ Added: vendor/mruby-b5830ae/include/mruby/proc.h (+62 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby/proc.h 2013-01-09 13:19:18 +0900 (745d56b) @@ -0,0 +1,62 @@ +/* +** mruby/proc.h - Proc class +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBY_PROC_H +#define MRUBY_PROC_H + +#include "mruby/irep.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +struct REnv { + MRB_OBJECT_HEADER; + mrb_value *stack; + mrb_sym mid; + int cioff; +}; + +struct RProc { + MRB_OBJECT_HEADER; + union { + mrb_irep *irep; + mrb_func_t func; + } body; + struct RClass *target_class; + struct REnv *env; +}; + +/* aspec access */ +#define ARGS_GETREQ(a) (((a) >> 19) & 0x1f) +#define ARGS_GETOPT(a) (((a) >> 14) & 0x1f) +#define ARGS_GETREST(a) ((a) & (1<<13)) +#define ARGS_GETPOST(a) (((a) >> 8) & 0x1f) +#define ARGS_GETKEY(a) (((a) >> 3) & 0x1f)) +#define ARGS_GETKDICT(a) ((a) & (1<<2)) +#define ARGS_GETBLOCK(a) ((a) & (1<<1)) + +#define MRB_PROC_CFUNC 128 +#define MRB_PROC_CFUNC_P(p) ((p)->flags & MRB_PROC_CFUNC) +#define MRB_PROC_STRICT 256 +#define MRB_PROC_STRICT_P(p) ((p)->flags & MRB_PROC_STRICT) + +#define mrb_proc_ptr(v) ((struct RProc*)((v).value.p)) + +struct RProc *mrb_proc_new(mrb_state*, mrb_irep*); +struct RProc *mrb_proc_new_cfunc(mrb_state*, mrb_func_t); +struct RProc *mrb_closure_new(mrb_state*, mrb_irep*); +struct RProc *mrb_closure_new_cfunc(mrb_state *mrb, mrb_func_t func, int nlocals); +void mrb_proc_copy(struct RProc *a, struct RProc *b); + +#include "mruby/khash.h" +KHASH_DECLARE(mt, mrb_sym, struct RProc*, 1) + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* MRUBY_PROC_H */ Added: vendor/mruby-b5830ae/include/mruby/range.h (+35 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby/range.h 2013-01-09 13:19:18 +0900 (4f1f380) @@ -0,0 +1,35 @@ +/* +** mruby/range.h - Range class +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBY_RANGE_H +#define MRUBY_RANGE_H + +#if defined(__cplusplus) +extern "C" { +#endif + +struct mrb_range_edges { + mrb_value beg; + mrb_value end; +}; + +struct RRange { + MRB_OBJECT_HEADER; + struct mrb_range_edges *edges; + int excl; +}; + +#define mrb_range_ptr(v) ((struct RRange*)((v).value.p)) +#define mrb_range_value(p) mrb_obj_value((void*)(p)) + +mrb_value mrb_range_new(mrb_state*, mrb_value, mrb_value, int); +mrb_int mrb_range_beg_len(mrb_state *mrb, mrb_value range, mrb_int *begp, mrb_int *lenp, mrb_int len, mrb_int err); + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* MRUBY_RANGE_H */ Added: vendor/mruby-b5830ae/include/mruby/string.h (+90 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby/string.h 2013-01-09 13:19:18 +0900 (cd2c83d) @@ -0,0 +1,90 @@ +/* +** mruby/string.h - String class +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBY_STRING_H +#define MRUBY_STRING_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#ifdef INCLUDE_ENCODING +#include "encoding.h" +#endif + +#ifndef RB_GC_GUARD +#define RB_GC_GUARD(v) v +#endif + +#define IS_EVSTR(p,e) ((p) < (e) && (*(p) == '$' || *(p) == '@' || *(p) == '{')) + +#define STR_BUF_MIN_SIZE 128 + +extern const char mrb_digitmap[]; + +struct mrb_shared_string { + int refcnt; + char *ptr; + int len; +}; + +struct RString { + MRB_OBJECT_HEADER; + int len; + union { + int capa; + struct mrb_shared_string *shared; + } aux; + char *ptr; +}; + +#define mrb_str_ptr(s) ((struct RString*)((s).value.p)) +#define RSTRING(s) ((struct RString*)((s).value.p)) +#define RSTRING_PTR(s) (RSTRING(s)->ptr) +#define RSTRING_LEN(s) (RSTRING(s)->len) +#define RSTRING_CAPA(s) (RSTRING(s)->aux.capa) +#define RSTRING_END(s) (RSTRING(s)->ptr + RSTRING(s)->len) +#define MRB_STR_SHARED 256 + +void mrb_str_decref(mrb_state*, struct mrb_shared_string*); +mrb_value mrb_str_literal(mrb_state*, mrb_value); +void mrb_str_concat(mrb_state*, mrb_value, mrb_value); +mrb_value mrb_str_plus(mrb_state*, mrb_value, mrb_value); +mrb_value mrb_obj_as_string(mrb_state *mrb, mrb_value obj); +mrb_value mrb_str_resize(mrb_state *mrb, mrb_value str, int len); /* mrb_str_resize */ +mrb_value mrb_string_value(mrb_state *mrb, mrb_value *ptr); /* StringValue */ +mrb_value mrb_str_substr(mrb_state *mrb, mrb_value str, mrb_int beg, int len); +mrb_value mrb_check_string_type(mrb_state *mrb, mrb_value str); +mrb_value mrb_str_buf_new(mrb_state *mrb, int capa); +mrb_value mrb_str_buf_cat(mrb_state *mrb, mrb_value str, const char *ptr, int len); + +char *mrb_string_value_cstr(mrb_state *mrb, mrb_value *ptr); +char *mrb_string_value_ptr(mrb_state *mrb, mrb_value ptr); +int mrb_str_sublen(mrb_state *mrb, mrb_value str, int pos); +int mrb_str_offset(mrb_state *mrb, mrb_value str, int pos); +mrb_value mrb_str_dup(mrb_state *mrb, mrb_value str); /* mrb_str_dup */ +mrb_value mrb_str_intern(mrb_state *mrb, mrb_value self); +mrb_value mrb_str_cat2(mrb_state *mrb, mrb_value str, const char *ptr); +mrb_value mrb_str_catf(mrb_state *mrb, mrb_value str, const char *format, ...); +mrb_value mrb_str_to_inum(mrb_state *mrb, mrb_value str, int base, int badcheck); +double mrb_str_to_dbl(mrb_state *mrb, mrb_value str, int badcheck); +mrb_value mrb_str_to_str(mrb_state *mrb, mrb_value str); +mrb_int mrb_str_hash(mrb_state *mrb, mrb_value str); +int mrb_str_hash_cmp(mrb_state *mrb, mrb_value str1, mrb_value str2); +mrb_value mrb_str_buf_append(mrb_state *mrb, mrb_value str, mrb_value str2); +mrb_value mrb_str_inspect(mrb_state *mrb, mrb_value str); +int mrb_str_equal(mrb_state *mrb, mrb_value str1, mrb_value str2); +mrb_value mrb_str_dump(mrb_state *mrb, mrb_value str); +mrb_value mrb_str_cat(mrb_state *mrb, mrb_value str, const char *ptr, long len); +mrb_value mrb_str_append(mrb_state *mrb, mrb_value str, mrb_value str2); + +int mrb_str_cmp(mrb_state *mrb, mrb_value str1, mrb_value str2); + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* MRUBY_STRING_H */ Added: vendor/mruby-b5830ae/include/mruby/struct.h (+27 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby/struct.h 2013-01-09 13:19:18 +0900 (cfe6df1) @@ -0,0 +1,27 @@ +/* +** mruby/struct.h - Struct class +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBY_STRUCT_H +#define MRUBY_STRUCT_H + +#if defined(__cplusplus) +extern "C" { +#endif + +struct RStruct { + struct RBasic basic; + long len; + mrb_value *ptr; +}; +#define RSTRUCT(st) ((struct RStruct*)((st).value.p)) +#define RSTRUCT_LEN(st) ((int)(RSTRUCT(st)->len)) +#define RSTRUCT_PTR(st) (RSTRUCT(st)->ptr) + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* MRUBY_STRUCT_H */ Added: vendor/mruby-b5830ae/include/mruby/value.h (+280 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby/value.h 2013-01-09 13:19:18 +0900 (ab56c97) @@ -0,0 +1,280 @@ +/* +** mruby/value.h - mrb_value definition +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBY_VALUE_H +#define MRUBY_VALUE_H + +#ifndef MRB_NAN_BOXING + +enum mrb_vtype { + MRB_TT_FALSE = 0, /* 0 */ + MRB_TT_FREE, /* 1 */ + MRB_TT_TRUE, /* 2 */ + MRB_TT_FIXNUM, /* 3 */ + MRB_TT_SYMBOL, /* 4 */ + MRB_TT_UNDEF, /* 5 */ + MRB_TT_FLOAT, /* 6 */ + MRB_TT_VOIDP, /* 7 */ + MRB_TT_MAIN, /* 8 */ + MRB_TT_OBJECT, /* 9 */ + MRB_TT_CLASS, /* 10 */ + MRB_TT_MODULE, /* 11 */ + MRB_TT_ICLASS, /* 12 */ + MRB_TT_SCLASS, /* 13 */ + MRB_TT_PROC, /* 14 */ + MRB_TT_ARRAY, /* 15 */ + MRB_TT_HASH, /* 16 */ + MRB_TT_STRING, /* 17 */ + MRB_TT_RANGE, /* 18 */ + MRB_TT_REGEX, /* 19 */ + MRB_TT_STRUCT, /* 20 */ + MRB_TT_EXCEPTION, /* 21 */ + MRB_TT_MATCH, /* 22 */ + MRB_TT_FILE, /* 23 */ + MRB_TT_ENV, /* 24 */ + MRB_TT_DATA, /* 25 */ + MRB_TT_MAXDEFINE /* 26 */ +}; + +typedef struct mrb_value { + union { + mrb_float f; + void *p; + mrb_int i; + mrb_sym sym; + } value; + enum mrb_vtype tt:8; +} mrb_value; + +#define mrb_type(o) (o).tt +#define mrb_float(o) (o).value.f + +#define MRB_SET_VALUE(o, ttt, attr, v) do {\ + (o).tt = ttt;\ + (o).attr = v;\ +} while (0); + +static inline mrb_value +mrb_float_value(mrb_float f) +{ + mrb_value v; + + MRB_SET_VALUE(v, MRB_TT_FLOAT, value.f, f); + return v; +} +#else /* MRB_NAN_BOXING */ + +#ifdef MRB_USE_FLOAT +# error ---->> MRB_NAN_BOXING and MRB_USE_FLOAT conflict <<---- +#endif + +enum mrb_vtype { + MRB_TT_FALSE = 1, /* 1 */ + MRB_TT_FREE, /* 2 */ + MRB_TT_TRUE, /* 3 */ + MRB_TT_FIXNUM, /* 4 */ + MRB_TT_SYMBOL, /* 5 */ + MRB_TT_UNDEF, /* 6 */ + MRB_TT_FLOAT, /* 7 */ + MRB_TT_VOIDP, /* 8 */ + MRB_TT_MAIN, /* 9 */ + MRB_TT_OBJECT, /* 10 */ + MRB_TT_CLASS, /* 11 */ + MRB_TT_MODULE, /* 12 */ + MRB_TT_ICLASS, /* 13 */ + MRB_TT_SCLASS, /* 14 */ + MRB_TT_PROC, /* 15 */ + MRB_TT_ARRAY, /* 16 */ + MRB_TT_HASH, /* 17 */ + MRB_TT_STRING, /* 18 */ + MRB_TT_RANGE, /* 19 */ + MRB_TT_REGEX, /* 20 */ + MRB_TT_STRUCT, /* 21 */ + MRB_TT_EXCEPTION, /* 22 */ + MRB_TT_MATCH, /* 23 */ + MRB_TT_FILE, /* 24 */ + MRB_TT_ENV, /* 25 */ + MRB_TT_DATA, /* 26 */ + MRB_TT_MAXDEFINE /* 27 */ +}; + +#ifdef MRB_ENDIAN_BIG +#define MRB_ENDIAN_LOHI(a,b) a b +#else +#define MRB_ENDIAN_LOHI(a,b) b a +#endif + +typedef struct mrb_value { + union { + mrb_float f; + struct { + MRB_ENDIAN_LOHI( + uint32_t ttt; + ,union { + void *p; + mrb_int i; + mrb_sym sym; + } value; + ) + }; + }; +} mrb_value; + +#define mrb_tt(o) ((o).ttt & 0xff) +#define mrb_mktt(tt) (0xfff00000|(tt)) +#define mrb_type(o) ((uint32_t)0xfff00000 < (o).ttt ? mrb_tt(o) : MRB_TT_FLOAT) +#define mrb_float(o) (o).f + +#define MRB_SET_VALUE(o, tt, attr, v) do {\ + (o).ttt = mrb_mktt(tt);\ + (o).attr = v;\ +} while (0); + +static inline mrb_value +mrb_float_value(mrb_float f) +{ + mrb_value v; + + if (f != f) { + v.ttt = 0x7ff80000; + v.value.i = 0; + } else { + v.f = f; + } + return v; +} +#endif /* MRB_NAN_BOXING */ + +#define mrb_fixnum(o) (o).value.i +#define mrb_symbol(o) (o).value.sym +#define mrb_object(o) ((struct RBasic *) (o).value.p) +#define mrb_voidp(o) (o).value.p +#define mrb_fixnum_p(o) (mrb_type(o) == MRB_TT_FIXNUM) +#define mrb_float_p(o) (mrb_type(o) == MRB_TT_FLOAT) +#define mrb_undef_p(o) (mrb_type(o) == MRB_TT_UNDEF) +#define mrb_nil_p(o) (mrb_type(o) == MRB_TT_FALSE && !(o).value.i) +#define mrb_symbol_p(o) (mrb_type(o) == MRB_TT_SYMBOL) +#define mrb_array_p(o) (mrb_type(o) == MRB_TT_ARRAY) +#define mrb_string_p(o) (mrb_type(o) == MRB_TT_STRING) +#define mrb_hash_p(o) (mrb_type(o) == MRB_TT_HASH) +#define mrb_voidp_p(o) (mrb_type(o) == MRB_TT_VOIDP) +#define mrb_test(o) (mrb_type(o) != MRB_TT_FALSE) + +#define MRB_OBJECT_HEADER \ + enum mrb_vtype tt:8;\ + unsigned int color:3;\ + unsigned int flags:21;\ + struct RClass *c;\ + struct RBasic *gcnext + +/* white: 011, black: 100, gray: 000 */ +#define MRB_GC_GRAY 0 +#define MRB_GC_WHITE_A 1 +#define MRB_GC_WHITE_B (1 << 1) +#define MRB_GC_BLACK (1 << 2) +#define MRB_GC_WHITES (MRB_GC_WHITE_A | MRB_GC_WHITE_B) +#define MRB_GC_COLOR_MASK 7 + +#define paint_gray(o) ((o)->color = MRB_GC_GRAY) +#define paint_black(o) ((o)->color = MRB_GC_BLACK) +#define paint_white(o) ((o)->color = MRB_GC_WHITES) +#define paint_partial_white(s, o) ((o)->color = (s)->current_white_part) +#define is_gray(o) ((o)->color == MRB_GC_GRAY) +#define is_white(o) ((o)->color & MRB_GC_WHITES) +#define is_black(o) ((o)->color & MRB_GC_BLACK) +#define is_dead(s, o) (((o)->color & other_white_part(s) & MRB_GC_WHITES) || (o)->tt == MRB_TT_FREE) +#define flip_white_part(s) ((s)->current_white_part = other_white_part(s)) +#define other_white_part(s) ((s)->current_white_part ^ MRB_GC_WHITES) + +struct RBasic { + MRB_OBJECT_HEADER; +}; + +#define mrb_basic(v) ((struct RBasic*)((v).value.p)) + +struct RObject { + MRB_OBJECT_HEADER; + struct iv_tbl *iv; +}; + +#define mrb_obj_ptr(v) ((struct RObject*)((v).value.p)) +#define mrb_immediate_p(x) (mrb_type(x) <= MRB_TT_MAIN) +#define mrb_special_const_p(x) mrb_immediate_p(x) + +static inline mrb_value +mrb_fixnum_value(mrb_int i) +{ + mrb_value v; + + MRB_SET_VALUE(v, MRB_TT_FIXNUM, value.i, i); + return v; +} + +static inline mrb_value +mrb_symbol_value(mrb_sym i) +{ + mrb_value v; + + MRB_SET_VALUE(v, MRB_TT_SYMBOL, value.sym, i); + return v; +} + +static inline mrb_value +mrb_obj_value(void *p) +{ + mrb_value v; + struct RBasic *b = (struct RBasic*)p; + + MRB_SET_VALUE(v, b->tt, value.p, p); + return v; +} + +static inline mrb_value +mrb_voidp_value(void *p) +{ + mrb_value v; + + MRB_SET_VALUE(v, MRB_TT_VOIDP, value.p, p); + return v; +} + +static inline mrb_value +mrb_false_value(void) +{ + mrb_value v; + + MRB_SET_VALUE(v, MRB_TT_FALSE, value.i, 1); + return v; +} + +static inline mrb_value +mrb_nil_value(void) +{ + mrb_value v; + + MRB_SET_VALUE(v, MRB_TT_FALSE, value.i, 0); + return v; +} + +static inline mrb_value +mrb_true_value(void) +{ + mrb_value v; + + MRB_SET_VALUE(v, MRB_TT_TRUE, value.i, 1); + return v; +} + +static inline mrb_value +mrb_undef_value(void) +{ + mrb_value v; + + MRB_SET_VALUE(v, MRB_TT_UNDEF, value.i, 0); + return v; +} + +#endif /* MRUBY_OBJECT_H */ Added: vendor/mruby-b5830ae/include/mruby/variable.h (+76 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/include/mruby/variable.h 2013-01-09 13:19:18 +0900 (f2f22e6) @@ -0,0 +1,76 @@ +/* +** mruby/variable.h - mruby variables +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBY_VARIABLE_H +#define MRUBY_VARIABLE_H + +#if defined(__cplusplus) +extern "C" { +#endif + +typedef struct global_variable { + int counter; + mrb_value *data; + mrb_value (*getter)(void); + void (*setter)(void); + //void (*marker)(); + //int block_trace; + //struct trace_var *trace; +} global_variable; + +struct global_entry { + global_variable *var; + mrb_sym id; +}; + +mrb_value mrb_vm_special_get(mrb_state*, mrb_sym); +void mrb_vm_special_set(mrb_state*, mrb_sym, mrb_value); +mrb_value mrb_vm_iv_get(mrb_state*, mrb_sym); +void mrb_vm_iv_set(mrb_state*, mrb_sym, mrb_value); +mrb_value mrb_vm_cv_get(mrb_state*, mrb_sym); +void mrb_vm_cv_set(mrb_state*, mrb_sym, mrb_value); +mrb_value mrb_vm_const_get(mrb_state*, mrb_sym); +void mrb_vm_const_set(mrb_state*, mrb_sym, mrb_value); +mrb_value mrb_const_get(mrb_state*, mrb_value, mrb_sym); +void mrb_const_set(mrb_state*, mrb_value, mrb_sym, mrb_value); +int mrb_const_defined(mrb_state*, mrb_value, mrb_sym); + +mrb_value mrb_obj_iv_get(mrb_state *mrb, struct RObject *obj, mrb_sym sym); +void mrb_obj_iv_set(mrb_state *mrb, struct RObject *obj, mrb_sym sym, mrb_value v); +int mrb_obj_iv_defined(mrb_state *mrb, struct RObject *obj, mrb_sym sym); +void mrb_obj_iv_ifnone(mrb_state *mrb, struct RObject *obj, mrb_sym sym, mrb_value v); +mrb_value mrb_iv_get(mrb_state *mrb, mrb_value obj, mrb_sym sym); +void mrb_iv_set(mrb_state *mrb, mrb_value obj, mrb_sym sym, mrb_value v); +int mrb_iv_defined(mrb_state*, mrb_value, mrb_sym); +mrb_value mrb_iv_remove(mrb_state *mrb, mrb_value obj, mrb_sym sym); +void mrb_iv_copy(mrb_state *mrb, mrb_value dst, mrb_value src); +int mrb_const_defined_at(mrb_state *mrb, struct RClass *klass, mrb_sym id); +mrb_value mrb_f_global_variables(mrb_state *mrb, mrb_value self); +mrb_value mrb_gv_get(mrb_state *mrb, mrb_sym sym); +void mrb_gv_set(mrb_state *mrb, mrb_sym sym, mrb_value val); +mrb_value mrb_obj_instance_variables(mrb_state*, mrb_value); +mrb_value mrb_obj_iv_inspect(mrb_state*, struct RObject*); +mrb_sym mrb_class_sym(mrb_state *mrb, struct RClass *c, struct RClass *outer); +mrb_value mrb_mod_class_variables(mrb_state*, mrb_value); +mrb_value mrb_mod_cv_get(mrb_state *mrb, struct RClass * c, mrb_sym sym); +mrb_value mrb_cv_get(mrb_state *mrb, mrb_value mod, mrb_sym sym); +void mrb_mod_cv_set(mrb_state *mrb, struct RClass * c, mrb_sym sym, mrb_value v); +void mrb_cv_set(mrb_state *mrb, mrb_value mod, mrb_sym sym, mrb_value v); +int mrb_mod_cv_defined(mrb_state *mrb, struct RClass * c, mrb_sym sym); +int mrb_cv_defined(mrb_state *mrb, mrb_value mod, mrb_sym sym); + +/* GC functions */ +void mrb_gc_mark_gv(mrb_state*); +void mrb_gc_free_gv(mrb_state*); +void mrb_gc_mark_iv(mrb_state*, struct RObject*); +size_t mrb_gc_mark_iv_size(mrb_state*, struct RObject*); +void mrb_gc_free_iv(mrb_state*, struct RObject*); + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* MRUBY_VARIABLE_H */ Added: vendor/mruby-b5830ae/minirake (+472 -0) 100755 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/minirake 2013-01-09 13:19:18 +0900 (00a2e64) @@ -0,0 +1,472 @@ +#!/usr/bin/env ruby + +# Original is https://github.com/jimweirich/rake/ +# Copyright (c) 2003 Jim Weirich +# License: MIT-LICENSE + +require 'getoptlong' +require 'fileutils' + +class String + def ext(newext='') + return self.dup if ['.', '..'].include? self + if newext != '' + newext = (newext =~ /^\./) ? newext : ("." + newext) + end + self.chomp(File.extname(self)) << newext + end + + def pathmap(spec=nil, &block) + return self if spec.nil? + result = '' + spec.scan(/%\{[^}]*\}-?\d*[sdpfnxX%]|%-?\d+d|%.|[^%]+/) do |frag| + case frag + when '%f' + result << File.basename(self) + when '%n' + result << File.basename(self).ext + when '%d' + result << File.dirname(self) + when '%x' + result << File.extname(self) + when '%X' + result << self.ext + when '%p' + result << self + when '%s' + result << (File::ALT_SEPARATOR || File::SEPARATOR) + when '%-' + # do nothing + when '%%' + result << "%" + when /%(-?\d+)d/ + result << pathmap_partial($1.to_i) + when /^%\{([^}]*)\}(\d*[dpfnxX])/ + patterns, operator = $1, $2 + result << pathmap('%' + operator).pathmap_replace(patterns, &block) + when /^%/ + fail ArgumentError, "Unknown pathmap specifier #{frag} in '#{spec}'" + else + result << frag + end + end + result + end +end + +module MiniRake + class Task + TASKS = Hash.new + RULES = Array.new + + # List of prerequisites for a task. + attr_reader :prerequisites + + # Source dependency for rule synthesized tasks. Nil if task was not + # sythesized from a rule. + attr_accessor :source + + # Create a task named +task_name+ with no actions or prerequisites.. + # use +enhance+ to add actions and prerequisites. + def initialize(task_name) + @name = task_name + @prerequisites = [] + @actions = [] + end + + # Enhance a task with prerequisites or actions. Returns self. + def enhance(deps=nil, &block) + @prerequisites |= deps if deps + @actions << block if block_given? + self + end + + # Name of the task. + def name + @name.to_s + end + + # Invoke the task if it is needed. Prerequites are invoked first. + def invoke + puts "Invoke #{name} (already=[#{@already_invoked}], needed=[#{needed?}])" if $trace + return if @already_invoked + @already_invoked = true + prerequisites =****@prere*****{ |n| n.is_a?(Proc) ? n.call(name) : n }.flatten + prerequisites.each { |n| Task[n].invoke } + execute if needed? + end + + # Execute the actions associated with this task. + def execute + puts "Execute #{name}" if $trace + self.class.enhance_with_matching_rule(name) if****@actio*****? + unless $dryrun + @actions.each { |act| result = act.call(self) } + end + end + + # Is this task needed? + def needed? + true + end + + # Timestamp for this task. Basic tasks return the current time for + # their time stamp. Other tasks can be more sophisticated. + def timestamp + prerequisites =****@prere*****{ |n| n.is_a?(Proc) ? n.call(name) : n }.flatten + prerequisites.collect { |n| Task[n].timestamp }.max || Time.now + end + + # Class Methods ---------------------------------------------------- + + class << self + + # Clear the task list. This cause rake to immediately forget all + # the tasks that have been assigned. (Normally used in the unit + # tests.) + def clear + TASKS.clear + RULES.clear + end + + # List of all defined tasks. + def tasks + TASKS.keys.sort.collect { |tn| Task[tn] } + end + + # Return a task with the given name. If the task is not currently + # known, try to synthesize one from the defined rules. If no + # rules are found, but an existing file matches the task name, + # assume it is a file task with no dependencies or actions. + def [](task_name) + task_name = task_name.to_s + if task = TASKS[task_name] + return task + end + if task = enhance_with_matching_rule(task_name) + return task + end + if File.exist?(task_name) + return FileTask.define_task(task_name) + end + fail "Don't know how to rake #{task_name}" + end + + # Define a task given +args+ and an option block. If a rule with + # the given name already exists, the prerequisites and actions are + # added to the existing task. + def define_task(args, &block) + task_name, deps = resolve_args(args) + lookup(task_name).enhance([deps].flatten, &block) + end + + # Define a rule for synthesizing tasks. + def create_rule(args, &block) + pattern, deps = resolve_args(args) + pattern = Regexp.new(Regexp.quote(pattern) + '$') if String === pattern + RULES << [pattern, deps, block] + end + + + # Lookup a task. Return an existing task if found, otherwise + # create a task of the current type. + def lookup(task_name) + name = task_name.to_s + TASKS[name] ||= self.new(name) + end + + # If a rule can be found that matches the task name, enhance the + # task with the prerequisites and actions from the rule. Set the + # source attribute of the task appropriately for the rule. Return + # the enhanced task or nil of no rule was found. + def enhance_with_matching_rule(task_name) + RULES.each do |pattern, extensions, block| + if md = pattern.match(task_name) + ext = extensions.first + deps = extensions[1..-1] + case ext + when String + source = task_name.sub(/\.[^.]*$/, ext) + when Proc + source = ext.call(task_name) + else + fail "Don't know how to handle rule dependent: #{ext.inspect}" + end + if File.exist?(source) + task = FileTask.define_task({task_name => [source]+deps}, &block) + task.source = source + return task + end + end + end + nil + end + + private + + # Resolve the arguments for a task/rule. + def resolve_args(args) + case args + when Hash + fail "Too Many Task Names: #{args.keys.join(' ')}" if args.size > 1 + fail "No Task Name Given" if args.size < 1 + task_name = args.keys[0] + deps = args[task_name] + deps = [deps] if (String===deps) || (Regexp===deps) || (Proc===deps) + else + task_name = args + deps = [] + end + [task_name, deps] + end + end + end + + + ###################################################################### + class FileTask < Task + # Is this file task needed? Yes if it doesn't exist, or if its time + # stamp is out of date. + def needed? + return true unless File.exist?(name) + prerequisites =****@prere*****{ |n| n.is_a?(Proc) ? n.call(name) : n }.flatten + latest_prereq = prerequisites.collect{|n| Task[n].timestamp}.max + return false if latest_prereq.nil? + timestamp < latest_prereq + end + + # Time stamp for file task. + def timestamp + File.new(name.to_s).mtime + end + end + + module DSL + # Declare a basic task. + def task(args, &block) + MiniRake::Task.define_task(args, &block) + end + + # Declare a file task. + def file(args, &block) + MiniRake::FileTask.define_task(args, &block) + end + + # Declare a set of files tasks to create the given directories on + # demand. + def directory(dir) + path = [] + Sys.split_all(dir).each do |p| + path << p + FileTask.define_task(File.join(path)) do |t| + Sys.makedirs(t.name) + end + end + end + + # Declare a rule for auto-tasks. + def rule(args, &block) + MiniRake::Task.create_rule(args, &block) + end + + # Write a message to standard out if $verbose is enabled. + def log(msg) + print " " if $trace && $verbose + puts msg if $verbose + end + + # Run the system command +cmd+. + def sh(cmd) + puts cmd + system(cmd) or fail "Command Failed: [#{cmd}]" + end + + def desc(text) + end + end +end + +Rake = MiniRake +include MiniRake::DSL + + +###################################################################### +# Task Definition Functions ... + +###################################################################### +# Rake main application object. When invoking +rake+ from the command +# line, a RakeApp object is created and run. +# +class RakeApp + RAKEFILES = ['rakefile', 'Rakefile'] + + OPTIONS = [ + ['--dry-run', '-n', GetoptLong::NO_ARGUMENT, + "Do a dry run without executing actions."], + ['--help', '-H', GetoptLong::NO_ARGUMENT, + "Display this help message."], + ['--libdir', '-I', GetoptLong::REQUIRED_ARGUMENT, + "Include LIBDIR in the search path for required modules."], + ['--nosearch', '-N', GetoptLong::NO_ARGUMENT, + "Do not search parent directories for the Rakefile."], + ['--quiet', '-q', GetoptLong::NO_ARGUMENT, + "Do not log messages to standard output."], + ['--rakefile', '-f', GetoptLong::REQUIRED_ARGUMENT, + "Use FILE as the rakefile."], + ['--require', '-r', GetoptLong::REQUIRED_ARGUMENT, + "Require MODULE before executing rakefile."], + ['--tasks', '-T', GetoptLong::NO_ARGUMENT, + "Display the tasks and dependencies, then exit."], + ['--trace', '-t', GetoptLong::NO_ARGUMENT, + "Turn on invoke/execute tracing."], + ['--usage', '-h', GetoptLong::NO_ARGUMENT, + "Display usage."], + ['--verbose', '-v', GetoptLong::NO_ARGUMENT, + "Log message to standard output (default)."], + ] + + # Create a RakeApp object. + def initialize + @rakefile = nil + @nosearch = false + end + + # True if one of the files in RAKEFILES is in the current directory. + # If a match is found, it is copied into @rakefile. + def have_rakefile + RAKEFILES.each do |fn| + if File.exist?(fn) + @rakefile = fn + return true + end + end + return false + end + + # Display the program usage line. + def usage + puts "rake [-f rakefile] {options} targets..." + end + + # Display the rake command line help. + def help + usage + puts + puts "Options are ..." + puts + OPTIONS.sort.each do |long, short, mode, desc| + if mode == GetoptLong::REQUIRED_ARGUMENT + if desc =~ /\b([A-Z]{2,})\b/ + long = long + "=#{$1}" + end + end + printf " %-20s (%s)\n", long, short + printf " %s\n", desc + end + end + + # Display the tasks and dependencies. + def display_tasks + MiniRake::Task.tasks.each do |t| + puts "#{t.class} #{t.name}" + t.prerequisites.each { |pre| puts " #{pre}" } + end + end + + # Return a list of the command line options supported by the + # program. + def command_line_options + OPTIONS.collect { |lst| lst[0..-2] } + end + + # Do the option defined by +opt+ and +value+. + def do_option(opt, value) + case opt + when '--dry-run' + $dryrun = true + $trace = true + when '--help' + help + exit + when '--libdir' + $:.push(value) + when '--nosearch' + @nosearch = true + when '--quiet' + $verbose = false + when '--rakefile' + RAKEFILES.clear + RAKEFILES << value + when '--require' + require value + when '--tasks' + $show_tasks = true + when '--trace' + $trace = true + when '--usage' + usage + exit + when '--verbose' + $verbose = true + when '--version' + puts "rake, version #{RAKEVERSION}" + exit + else + fail "Unknown option: #{opt}" + end + end + + # Read and handle the command line options. + def handle_options + $verbose = true + opts = GetoptLong.new(*command_line_options) + opts.each { |opt, value| do_option(opt, value) } + end + + # Run the +rake+ application. + def run + handle_options + begin + here = Dir.pwd + while ! have_rakefile + Dir.chdir("..") + if Dir.pwd == here || @nosearch + fail "No Rakefile found (looking for: #{RAKEFILES.join(', ')})" + end + here = Dir.pwd + end + puts "(in #{Dir.pwd})" + $rakefile = @rakefile + load @rakefile + if $show_tasks + display_tasks + else + tasks = [] + ARGV.each do |task_name| + if /^(\w+)=(.*)/.match(task_name) + ENV[$1] = $2 + else + tasks << task_name + end + end + tasks.push("default") if tasks.size == 0 + tasks.each do |task_name| + MiniRake::Task[task_name].invoke + end + end + rescue Exception => ex + puts "rake aborted!" + puts ex.message + if $trace + puts ex.backtrace.join("\n") + else + puts ex.backtrace.find {|str| str =~ /#{@rakefile}/ } || "" + end + exit 1 + end + end +end + +if __FILE__ == $0 then + RakeApp.new.run +end Added: vendor/mruby-b5830ae/mrblib/array.rb (+105 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/mrblib/array.rb 2013-01-09 13:19:18 +0900 (3c4e2dd) @@ -0,0 +1,105 @@ +## +# Array +# +# ISO 15.2.12 +class Array + + ## + # Calls the given block for each element of +self+ + # and pass the respective element. + # + # ISO 15.2.12.5.10 + def each(&block) + idx, length = -1, self.length-1 + while(idx < length) + block.call(self[idx += 1]) + end + self + end + + ## + # Calls the given block for each element of +self+ + # and pass the index of the respective element. + # + # ISO 15.2.12.5.11 + def each_index(&block) + idx = 0 + while(idx < length) + block.call(idx) + idx += 1 + end + self + end + + ## + # Calls the given block for each element of +self+ + # and pass the respective element. Each element will + # be replaced by the resulting values. + # + # ISO 15.2.12.5.7 + def collect!(&block) + self.each_index{|idx| + self[idx] = block.call(self[idx]) + } + self + end + + ## + # Alias for collect! + # + # ISO 15.2.12.5.20 + alias map! collect! + + ## + # Private method for Array creation. + # + # ISO 15.2.12.5.15 + def initialize(size=0, obj=nil, &block) + raise TypeError, "expected Integer for 1st argument" unless size.kind_of? Integer + raise ArgumentError, "negative array size" if size < 0 + + self.clear + if size > 0 + self[size - 1] = nil # allocate + + idx = 0 + while(idx < size) + self[idx] = (block)? block.call(idx): obj + idx += 1 + end + end + + self + end + + ## + # Delete element with index +key+ + def delete(key, &block) + while i = self.index(key) + self.delete_at(i) + ret = key + end + if ret == nil && block + block.call + else + ret + end + end +end + +## +# Array is enumerable and comparable +module Enumerable; end +module Comparable; end +class Array + # ISO 15.2.12.3 + include Enumerable + include Comparable + + ## + # Sort all elements and replace +self+ with these + # elements. + def sort!(&block) + self.replace(self.sort(&block)) + end +end Added: vendor/mruby-b5830ae/mrblib/class.rb (+26 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/mrblib/class.rb 2013-01-09 13:19:18 +0900 (4f268b6) @@ -0,0 +1,26 @@ +class Module + # 15.2.2.4.13 + def attr_reader(*names) + names.each{|name| + name2 = ('@'+name.to_s).intern + define_method(name){self.instance_variable_get(name2)} + } + end + # 15.2.2.4.14 + def attr_writer(*names) + names.each{|name| + name2 = ('@'+name.to_s).intern + name = (name.to_s+"=").intern + define_method(name){|v|self.instance_variable_set(name2,v)} + } + end + # 15.2.2.4.12 + def attr_accessor(*names) + attr_reader(*names) + attr_writer(*names) + end + # 15.2.2.4.11 + def attr(name) + attr_reader(name) + end +end Added: vendor/mruby-b5830ae/mrblib/compar.rb (+104 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/mrblib/compar.rb 2013-01-09 13:19:18 +0900 (9f2ab88) @@ -0,0 +1,104 @@ +## +# Comparable +# +# ISO 15.3.3 +module Comparable + + ## + # Return true if +self+ is less + # than +other+. Otherwise return + # false. + # + # ISO 15.3.3.2.1 + def < other + cmp = self <=> other + if cmp.nil? + false + elsif cmp < 0 + true + else + false + end + end + + ## + # Return true if +self+ is less + # than or equal to +other+. + # Otherwise return false. + # + # ISO 15.3.3.2.2 + def <= other + cmp = self <=> other + if cmp.nil? + false + elsif cmp <= 0 + true + else + false + end + end + + ## + # Return true if +self+ is equal + # to +other+. Otherwise return + # false. + # + # ISO 15.3.3.2.3 + def == other + cmp = self <=> other + if cmp == 0 + true + else + false + end + end + + ## + # Return true if +self+ is greater + # than +other+. Otherwise return + # false. + # + # ISO 15.3.3.2.4 + def > other + cmp = self <=> other + if cmp.nil? + false + elsif cmp > 0 + true + else + false + end + end + + ## + # Return true if +self+ is greater + # than or equal to +other+. + # Otherwise return false. + # + # ISO 15.3.3.2.5 + def >= other + cmp = self <=> other + if cmp.nil? + false + elsif cmp >= 0 + true + else + false + end + end + + ## + # Return true if +self+ is greater + # than or equal to +min+ and + # less than or equal to +max+. + # Otherwise return false. + # + # ISO 15.3.3.2.6 + def between?(min, max) + if self < min or self > max + false + else + true + end + end +end Added: vendor/mruby-b5830ae/mrblib/enum.rb (+398 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/mrblib/enum.rb 2013-01-09 13:19:18 +0900 (2774bc8) @@ -0,0 +1,398 @@ +## +# Enumerable +# +# ISO 15.3.2 +# +# The <code>Enumerable</code> mixin provides collection classes with +# several traversal and searching methods, and with the ability to +# sort. The class must provide a method <code>each</code>, which +# yields successive members of the collection. If +# <code>Enumerable#max</code>, <code>#min</code>, or +# <code>#sort</code> is used, the objects in the collection must also +# implement a meaningful <code><=></code> operator, as these methods +# rely on an ordering between members of the collection. + +module Enumerable + + ## + # Call the given block for each element + # which is yield by +each+. Return false + # if one block value is false. Otherwise + # return true. If no block is given and + # +self+ is false return false. + # + # ISO 15.3.2.2.1 + def all?(&block) + st = true + if block + self.each{|val| + unless block.call(val) + st = false + break + end + } + else + self.each{|val| + unless val + st = false + break + end + } + end + st + end + + ## + # Call the given block for each element + # which is yield by +each+. Return true + # if one block value is true. Otherwise + # return false. If no block is given and + # +self+ is true object return true. + # + # ISO 15.3.2.2.2 + def any?(&block) + st = false + if block + self.each{|val| + if block.call(val) + st = true + break + end + } + else + self.each{|val| + if val + st = true + break + end + } + end + st + end + + ## + # Call the given block for each element + # which is yield by +each+. Append all + # values of each block together and + # return this value. + # + # ISO 15.3.2.2.3 + def collect(&block) + ary = [] + self.each{|val| + ary.push(block.call(val)) + } + ary + end + + ## + # Call the given block for each element + # which is yield by +each+. Return + # +ifnone+ if no block value was true. + # Otherwise return the first block value + # which had was true. + # + # ISO 15.3.2.2.4 + def detect(ifnone=nil, &block) + ret = ifnone + self.each{|val| + if block.call(val) + ret = val + break + end + } + ret + end + + ## + # Call the given block for each element + # which is yield by +each+. Pass an + # index to the block which starts at 0 + # and increase by 1 for each element. + # + # ISO 15.3.2.2.5 + def each_with_index(&block) + i = 0 + self.each{|val| + block.call(val, i) + i += 1 + } + self + end + + ## + # Return an array of all elements which + # are yield by +each+. + # + # ISO 15.3.2.2.6 + def entries + ary = [] + self.each{|val| + ary.push val + } + ary + end + + ## + # Alias for find + # + # ISO 15.3.2.2.7 + alias find detect + + ## + # Call the given block for each element + # which is yield by +each+. Return an array + # which contains all elements whose block + # value was true. + # + # ISO 15.3.2.2.8 + def find_all(&block) + ary = [] + self.each{|val| + ary.push(val) if block.call(val) + } + ary + end + + ## + # Call the given block for each element + # which is yield by +each+ and which return + # value was true when invoking === with + # +pattern+. Return an array with all + # elements or the respective block values. + # + # ISO 15.3.2.2.9 + def grep(pattern, &block) + ary = [] + self.each{|val| + if pattern === val + ary.push((block)? block.call(val): val) + end + } + ary + end + + ## + # Return true if at least one element which + # is yield by +each+ returns a true value + # by invoking == with +obj+. Otherwise return + # false. + # + # ISO 15.3.2.2.10 + def include?(obj) + st = false + self.each{|val| + if val == obj + st = true + break + end + } + st + end + + ## + # Call the given block for each element + # which is yield by +each+. Return value + # is the sum of all block values. Pass + # to each block the current sum and the + # current element. + # + # ISO 15.3.2.2.11 + def inject(*args, &block) + raise ArgumentError, "too many arguments" if args.size > 2 + if Symbol === args[-1] + sym = args[-1] + block = ->(x,y){x.send(sym,y)} + args.pop + end + if args.empty? + flag = true # no initial argument + result = nil + else + flag = false + result = args[0] + end + self.each{|val| + if flag + # push first element as initial + flag = false + result = val + else + result = block.call(result, val) + end + } + result + end + alias reduce inject + + ## + # Alias for collect + # + # ISO 15.3.2.2.12 + alias map collect + + ## + # Return the maximum value of all elements + # yield by +each+. If no block is given <=> + # will be invoked to define this value. If + # a block is given it will be used instead. + # + # ISO 15.3.2.2.13 + def max(&block) + flag = true # 1st element? + result = nil + self.each{|val| + if flag + # 1st element + result = val + flag = false + else + if block + result = val if block.call(val, result) > 0 + else + result = val if (val <=> result) > 0 + end + end + } + result + end + + ## + # Return the minimum value of all elements + # yield by +each+. If no block is given <=> + # will be invoked to define this value. If + # a block is given it will be used instead. + # + # ISO 15.3.2.2.14 + def min(&block) + flag = true # 1st element? + result = nil + self.each{|val| + if flag + # 1st element + result = val + flag = false + else + if block + result = val if block.call(val, result) < 0 + else + result = val if (val <=> result) < 0 + end + end + } + result + end + + ## + # Alias for include? + # + # ISO 15.3.2.2.15 + alias member? include? + + ## + # Call the given block for each element + # which is yield by +each+. Return an + # array which contains two arrays. The + # first array contains all elements + # whose block value was true. The second + # array contains all elements whose + # block value was false. + # + # ISO 15.3.2.2.16 + def partition(&block) + ary_T = [] + ary_F = [] + self.each{|val| + if block.call(val) + ary_T.push(val) + else + ary_F.push(val) + end + } + [ary_T, ary_F] + end + + ## + # Call the given block for each element + # which is yield by +each+. Return an + # array which contains only the elements + # whose block value was false. + # + # ISO 15.3.2.2.17 + def reject(&block) + ary = [] + self.each{|val| + ary.push(val) unless block.call(val) + } + ary + end + + ## + # Alias for find_all. + # + # ISO 15.3.2.2.18 + alias select find_all + + ## + # TODO + # Does this OK? Please test it. + def __sort_sub__(sorted, work, src_ary, head, tail, &block) + if head == tail + sorted[head] = work[head] if src_ary == 1 + return + end + + # on current step, which is a src ary? + if src_ary == 0 + src, dst = sorted, work + else + src, dst = work, sorted + end + + key = src[head] # key value for dividing values + i, j = head, tail # position to store on the dst ary + + (head + 1).upto(tail){|idx| + if ((block)? block.call(src[idx], key): (src[idx] <=> key)) > 0 + # larger than key + dst[j] = src[idx] + j -= 1 + else + dst[i] = src[idx] + i += 1 + end + } + + sorted[i] = key + + # sort each sub-array + src_ary = (src_ary + 1) % 2 # exchange a src ary + __sort_sub__(sorted, work, src_ary, head, i - 1, &block) if i > head + __sort_sub__(sorted, work, src_ary, i + 1, tail, &block) if i < tail + end +# private :__sort_sub__ + + ## + # Return a sorted array of all elements + # which are yield by +each+. If no block + # is given <=> will be invoked on each + # element to define the order. Otherwise + # the given block will be used for + # sorting. + # + # ISO 15.3.2.2.19 + def sort(&block) + ary = [] + self.each{|val| ary.push(val)} + unless ary.empty? + __sort_sub__(ary, ::Array.new(ary.size), 0, 0, ary.size - 1, &block) + end + ary + end + + ## + # Alias for entries. + # + # ISO 15.3.2.2.20 + alias to_a entries +end Added: vendor/mruby-b5830ae/mrblib/error.rb (+56 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/mrblib/error.rb 2013-01-09 13:19:18 +0900 (32b50da) @@ -0,0 +1,56 @@ +## +# Exception +# +# ISO 15.2.22 +class Exception + + ## + # Raise an exception. + # + # ISO 15.2.22.4.1 + def self.exception(*args, &block) + self.new(*args, &block) + end +end + +# ISO 15.2.24 +class ArgumentError < StandardError +end + +# ISO 15.2.25 +class LocalJumpError < StandardError +end + +# ISO 15.2.26 +class RangeError < StandardError +end + +class FloatDomainError < RangeError +end + +# ISO 15.2.26 +class RegexpError < StandardError +end + +# ISO 15.2.29 +class TypeError < StandardError +end + +# ISO 15.2.31 +class NameError < StandardError +end + +# ISO 15.2.32 +class NoMethodError < NameError +end + +# ISO 15.2.33 +class IndexError < StandardError +end + +class KeyError < IndexError +end + +class NotImplementedError < ScriptError +end + Added: vendor/mruby-b5830ae/mrblib/hash.rb (+148 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/mrblib/hash.rb 2013-01-09 13:19:18 +0900 (7b7b3f8) @@ -0,0 +1,148 @@ +## +# Hash +# +# ISO 15.2.13 +class Hash + + ## + # Delete the element with the key +key+. + # Return the value of the element if +key+ + # was found. Return nil if nothing was + # found. If a block is given, call the + # block with the value of the element. + # + # ISO 15.2.13.4.8 + def delete(key, &block) + if block && ! self.has_key?(key) + block.call(key) + else + self.__delete(key) + end + end + + ## + # Calls the given block for each element of +self+ + # and pass the key and value of each element. + # + # ISO 15.2.13.4.9 + def each(&block) + self.keys.each{|k| block.call([k, self[k]])} + self + end + + ## + # Calls the given block for each element of +self+ + # and pass the key of each element. + # + # ISO 15.2.13.4.10 + def each_key(&block) + self.keys.each{|k| block.call(k)} + self + end + + ## + # Calls the given block for each element of +self+ + # and pass the value of each element. + # + # ISO 15.2.13.4.11 + def each_value(&block) + self.keys.each{|k| block.call(self[k])} + self + end + + ## + # Create a direct instance of the class Hash. + # + # ISO 15.2.13.4.16 + def initialize(*args, &block) + self.__init_core(block, *args) + end + + ## + # Return a hash which contains the content of + # +self+ and +other+. If a block is given + # it will be called for each element with + # a duplicate key. The value of the block + # will be the final value of this element. + # + # ISO 15.2.13.4.22 + def merge(other, &block) + h = {} + raise "can't convert argument into Hash" unless other.respond_to?(:to_hash) + other = other.to_hash + self.each_key{|k| h[k] = self[k]} + if block + other.each_key{|k| + h[k] = (self.has_key?(k))? block.call(k, self[k], other[k]): other[k] + } + else + other.each_key{|k| h[k] = other[k]} + end + h + end + + # 1.8/1.9 Hash#reject! returns Hash; ISO says nothing. + def reject!(&b) + keys = [] + self.each_key{|k| + v = self[k] + if b.call(k, v) + keys.push(k) + end + } + return nil if keys.size == 0 + keys.each{|k| + self.delete(k) + } + self + end + + # 1.8/1.9 Hash#reject returns Hash; ISO says nothing. + def reject(&b) + h = {} + self.each_key{|k| + v = self[k] + unless b.call(k, v) + h[k] = v + end + } + h + end + + # 1.9 Hash#select! returns Hash; ISO says nothing. + def select!(&b) + keys = [] + self.each_key{|k| + v = self[k] + unless b.call(k, v) + keys.push(k) + end + } + return nil if keys.size == 0 + keys.each{|k| + self.delete(k) + } + self + end + + # 1.9 Hash#select returns Hash; ISO says nothing. + def select(&b) + h = {} + self.each_key{|k| + v = self[k] + if b.call(k, v) + h[k] = v + end + } + h + end +end + +## +# Hash is enumerable +# +# ISO 15.2.13.3 +module Enumerable; end +class Hash + include Enumerable +end Added: vendor/mruby-b5830ae/mrblib/init_mrblib.c (+14 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/mrblib/init_mrblib.c 2013-01-09 13:19:18 +0900 (eb7156b) @@ -0,0 +1,14 @@ +#include "mruby.h" +#include "mruby/irep.h" +#include "mruby/dump.h" +#include "mruby/string.h" +#include "mruby/proc.h" + +extern const char mrblib_irep[]; + +void +mrb_init_mrblib(mrb_state *mrb) +{ + mrb_load_irep(mrb, mrblib_irep); +} + Added: vendor/mruby-b5830ae/mrblib/kernel.rb (+35 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/mrblib/kernel.rb 2013-01-09 13:19:18 +0900 (ad3bc72) @@ -0,0 +1,35 @@ +## +# Kernel +# +# ISO 15.3.1 +module Kernel + ## + # Calls the given block repetitively. + # + # ISO 15.3.1.2.8 + def self.loop #(&block) + while(true) + yield + end + end + + # 15.3.1.2.3 + def self.eval(s) + raise NotImplementedError.new("eval not implemented") + end + + # 15.3.1.3.12 + def eval(s) + Kernel.eval(s) + end + + ## + # Alias for +Kernel.loop+. + # + # ISO 15.3.1.3.29 + def loop #(&block) + while(true) + yield + end + end +end Added: vendor/mruby-b5830ae/mrblib/mrblib.rake (+15 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/mrblib/mrblib.rake 2013-01-09 13:19:18 +0900 (5dab4ce) @@ -0,0 +1,15 @@ +dir = File.dirname(__FILE__).sub(%r|^\./|, '') + +MRuby.each_target do + self.libmruby << "#{build_dir}/#{dir}/mrblib.o" + + file "#{build_dir}/#{dir}/mrblib.o" => "#{build_dir}/#{dir}/mrblib.c" + file "#{build_dir}/#{dir}/mrblib.c" => [mrbcfile] + Dir.glob("#{dir}/*.rb") do |t| + mrbc, *rbfiles = t.prerequisites + FileUtils.mkdir_p File.dirname(t.name) + open(t.name, 'w') do |f| + f.puts File.read("#{dir}/init_mrblib.c") + compile_mruby f, rbfiles, 'mrblib_irep' + end + end +end Added: vendor/mruby-b5830ae/mrblib/numeric.rb (+69 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/mrblib/numeric.rb 2013-01-09 13:19:18 +0900 (1d701b1) @@ -0,0 +1,69 @@ +## +# Integer +# +# ISO 15.2.8 +class Integer + + ## + # Calls the given block once for each Integer + # from +self+ downto +num+. + # + # ISO 15.2.8.3.15 + def downto(num, &block) + i = self + while(i >= num) + block.call(i) + i -= 1 + end + self + end + + ## + # Calls the given block +self+ times. + # + # ISO 15.2.8.3.22 + def times(&block) + i = 0 + while(i < self) + block.call(i) + i += 1 + end + self + end + + ## + # Calls the given block once for each Integer + # from +self+ upto +num+. + # + # ISO 15.2.8.3.27 + def upto(num, &block) + i = self + while(i <= num) + block.call(i) + i += 1 + end + self + end + + ## + # Calls the given block from +self+ to +num+ + # incremented by +step+ (default 1). + # + def step(num, step=1, &block) + i = if num.kind_of? Float then self.to_f else self end + while(i <= num) + block.call(i) + i += step + end + self + end +end + +## +# Numeric is comparable +# +# ISO 15.2.7.3 +module Comparable; end +class Numeric + include Comparable +end Added: vendor/mruby-b5830ae/mrblib/print.rb (+80 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/mrblib/print.rb 2013-01-09 13:19:18 +0900 (68c7837) @@ -0,0 +1,80 @@ +## +# Kernel +# +# ISO 15.3.1 +module Kernel + unless Kernel.respond_to?(:__printstr__) + def print(*a) + raise NotImplementedError.new('print not available') + end + def puts(*a) + raise NotImplementedError.new('puts not available') + end + def p(*a) + raise NotImplementedError.new('p not available') + end + def printf(*args) + raise NotImplementedError.new('printf not available') + end + else + unless Kernel.respond_to?(:sprintf) + def printf(*args) + raise NotImplementedError.new('printf not available') + end + def sprintf(*args) + raise NotImplementedError.new('sprintf not available') + end + end + + + ## + # Invoke method +print+ on STDOUT and passing +*args+ + # + # ISO 15.3.1.2.10 + def print(*args) + i = 0 + len = args.size + while i < len + __printstr__ args[i].to_s + i += 1 + end + end + + ## + # Invoke method +puts+ on STDOUT and passing +*args*+ + # + # ISO 15.3.1.2.11 + def puts(*args) + i = 0 + len = args.size + while i < len + s = args[i].to_s + __printstr__ s + __printstr__ "\n" if (s[-1] != "\n") + i += 1 + end + __printstr__ "\n" if len == 0 + nil + end + + ## + # Print human readable object description + # + # ISO 15.3.1.3.34 + def p(*args) + i = 0 + len = args.size + while i < len + __printstr__ args[i].inspect + __printstr__ "\n" + i += 1 + end + args[0] + end + + def printf(*args) + __printstr__(sprintf(*args)) + nil + end + end +end Added: vendor/mruby-b5830ae/mrblib/range.rb (+39 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/mrblib/range.rb 2013-01-09 13:19:18 +0900 (44be030) @@ -0,0 +1,39 @@ +## +# Range +# +# ISO 15.2.14 +class Range + + ## + # Calls the given block for each element of +self+ + # and pass the respective element. + # + # ISO 15.2.14.4.4 + def each(&block) + val = self.first + unless val.respond_to? :succ + raise TypeError, "can't iterate" + end + + last = self.last + return self if (val <=> last) > 0 + + while((val <=> last) < 0) + block.call(val) + val = val.succ + end + + block.call(val) unless exclude_end? + + self + end +end + +## +# Range is enumerable +# +# ISO 15.2.14.3 +module Enumerable; end +class Range + include Enumerable +end Added: vendor/mruby-b5830ae/mrblib/string.rb (+147 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/mrblib/string.rb 2013-01-09 13:19:18 +0900 (43dda16) @@ -0,0 +1,147 @@ +## +# String +# +# ISO 15.2.10 +class String + + ## + # Calls the given block for each line + # and pass the respective line. + # + # ISO 15.2.10.5.15 + def each_line(&block) + # expect that str.index accepts an Integer for 1st argument as a byte data + offset = 0 + while(pos = self.index(0x0a, offset)) + block.call(self[offset, pos + 1 - offset]) + offset = pos + 1 + end + block.call(self[offset, self.size - offset]) if self.size > offset + self + end + + ## + # Replace all matches of +pattern+ with +replacement+. + # Call block (if given) for each match and replace + # +pattern+ with the value of the block. Return the + # final value. + # + # ISO 15.2.10.5.18 + def gsub(*args, &block) + unless (args.size == 1 && block) || args.size == 2 + raise ArgumentError, "wrong number of arguments" + end + + ### *** TODO *** ### + unless Object.const_defined?(:Regexp) + raise NotImplementedError, "gsub not available (yet)" + end + end + + ## + # Replace all matches of +pattern+ with +replacement+. + # Call block (if given) for each match and replace + # +pattern+ with the value of the block. Modify + # +self+ with the final value. + # + # ISO 15.2.10.5.19 + def gsub!(*args, &block) + str = self.gsub(*args, &block) + if str != self + self.replace(str) + self + else + nil + end + end + + ## + # Calls the given block for each match of +pattern+ + # If no block is given return an array with all + # matches of +pattern+. + # + # ISO 15.2.10.5.32 + def scan(reg, &block) + ### *** TODO *** ### + unless Object.const_defined?(:Regexp) + raise NotImplementedError, "scan not available (yet)" + end + end + + ## + # Replace only the first match of +pattern+ with + # +replacement+. Call block (if given) for each + # match and replace +pattern+ with the value of the + # block. Return the final value. + # + # ISO 15.2.10.5.36 + def sub(*args, &block) + unless (args.size == 1 && block) || args.size == 2 + raise ArgumentError, "wrong number of arguments" + end + + ### *** TODO *** ### + unless Object.const_defined?(:Regexp) + raise NotImplementedError, "sub not available (yet)" + end + end + + ## + # Replace only the first match of +pattern+ with + # +replacement+. Call block (if given) for each + # match and replace +pattern+ with the value of the + # block. Modify +self+ with the final value. + # + # ISO 15.2.10.5.37 + def sub!(*args, &block) + str = self.sub(*args, &block) + if str != self + self.replace(str) + self + else + nil + end + end + + ## + # Call the given block for each character of + # +self+. + def each_char(&block) + pos = 0 + while(pos < self.size) + block.call(self[pos]) + pos += 1 + end + self + end + + ## + # Call the given block for each byte of +self+. + def each_byte(&block) + bytes = self.bytes + pos = 0 + while(pos < bytes.size) + block.call(bytes[pos]) + pos += 1 + end + self + end + + ## + # Modify +self+ by replacing the content of +self+ + # at the position +pos+ with +value+. + def []=(pos, value) + b = self[0, pos] + a = self[pos+1..-1] + self.replace([b, value, a].join('')) + end +end + +## +# String is comparable +# +# ISO 15.2.10.3 +module Comparable; end +class String + include Comparable +end Added: vendor/mruby-b5830ae/mrblib/struct.rb (+50 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/mrblib/struct.rb 2013-01-09 13:19:18 +0900 (5d0ede9) @@ -0,0 +1,50 @@ +## +# Struct +# +# ISO 15.2.18 + +if Object.const_defined?(:Struct) + class Struct + + ## + # Calls the given block for each element of +self+ + # and pass the respective element. + # + # ISO 15.2.18.4.4 + def each(&block) + self.class.members.each{|field| + block.call(self[field]) + } + self + end + + ## + # Calls the given block for each element of +self+ + # and pass the name and value of the respectiev + # element. + # + # ISO 15.2.18.4.5 + def each_pair(&block) + self.class.members.each{|field| + block.call(field.to_sym, self[field]) + } + self + end + + ## + # Calls the given block for each element of +self+ + # and returns an array with all elements of which + # block is not false. + # + # ISO 15.2.18.4.7 + def select(&block) + ary = [] + self.class.members.each{|field| + val = self[field] + ary.push(val) if block.call(val) + } + ary + end + end +end + Added: vendor/mruby-b5830ae/src/array.c (+1162 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/array.c 2013-01-09 13:19:18 +0900 (d4f5d1c) @@ -0,0 +1,1162 @@ +/* +** array.c - Array class +** +** See Copyright Notice in mruby.h +*/ + +#include "mruby.h" +#include "mruby/array.h" +#include <string.h> +#include "mruby/string.h" +#include "mruby/class.h" + +#define ARY_DEFAULT_LEN 4 +#define ARY_SHRINK_RATIO 5 /* must be larger than 2 */ +#ifdef INT_MAX +# define ARY_MAX_SIZE (INT_MAX / sizeof(mrb_value)) +#endif + +static inline mrb_value +ary_elt(mrb_value ary, int offset) +{ + if (RARRAY_LEN(ary) == 0) return mrb_nil_value(); + if (offset < 0 || RARRAY_LEN(ary) <= offset) { + return mrb_nil_value(); + } + return RARRAY_PTR(ary)[offset]; +} + +static struct RArray* +ary_new_capa(mrb_state *mrb, int capa) +{ + struct RArray *a; + int blen; + +#ifdef INT_MAX + if (capa > ARY_MAX_SIZE) { + mrb_raise(mrb, E_ARGUMENT_ERROR, "ary size too big"); + } +#endif + blen = capa * sizeof(mrb_value) ; + if (blen < capa) { + mrb_raise(mrb, E_ARGUMENT_ERROR, "ary size too big"); + } + + a = (struct RArray*)mrb_obj_alloc(mrb, MRB_TT_ARRAY, mrb->array_class); + a->ptr = (mrb_value *)mrb_malloc(mrb, blen); + a->aux.capa = capa; + a->len = 0; + + return a; +} + +mrb_value +mrb_ary_new_capa(mrb_state *mrb, int capa) +{ + struct RArray *a = ary_new_capa(mrb, capa); + return mrb_obj_value(a); +} + +mrb_value +mrb_ary_new(mrb_state *mrb) +{ + return mrb_ary_new_capa(mrb, 0); +} + +static inline void +array_copy(mrb_value *dst, const mrb_value *src, size_t size) +{ + int i; + + for (i = 0; i < size; i++) { + dst[i] = src[i]; + } +} + + +mrb_value +mrb_ary_new_from_values(mrb_state *mrb, int size, mrb_value *vals) +{ + mrb_value ary; + struct RArray *a; + + ary = mrb_ary_new_capa(mrb, size); + a = mrb_ary_ptr(ary); + array_copy(a->ptr, vals, size); + a->len = size; + + return ary; +} + +mrb_value +mrb_assoc_new(mrb_state *mrb, mrb_value car, mrb_value cdr) +{ + mrb_value arv[2]; + arv[0] = car; + arv[1] = cdr; + return mrb_ary_new_from_values(mrb, 2, arv); +} + +static void +ary_fill_with_nil(mrb_value *ptr, int size) +{ + mrb_value nil = mrb_nil_value(); + + while((int)(size--)) { + *ptr++ = nil; + } +} + +static void +ary_modify(mrb_state *mrb, struct RArray *a) +{ + if (a->flags & MRB_ARY_SHARED) { + struct mrb_shared_array *shared = a->aux.shared; + + if (shared->refcnt == 1 && a->ptr == shared->ptr) { + a->ptr = shared->ptr; + a->aux.capa = a->len; + mrb_free(mrb, shared); + } + else { + mrb_value *ptr, *p; + int len; + + p = a->ptr; + len = a->len * sizeof(mrb_value); + ptr = (mrb_value *)mrb_malloc(mrb, len); + if (p) { + array_copy(ptr, p, a->len); + } + a->ptr = ptr; + a->aux.capa = a->len; + mrb_ary_decref(mrb, shared); + } + a->flags &= ~MRB_ARY_SHARED; + } +} + +static void +ary_make_shared(mrb_state *mrb, struct RArray *a) +{ + if (!(a->flags & MRB_ARY_SHARED)) { + struct mrb_shared_array *shared = (struct mrb_shared_array *)mrb_malloc(mrb, sizeof(struct mrb_shared_array)); + + shared->refcnt = 1; + if (a->aux.capa > a->len) { + a->ptr = shared->ptr = (mrb_value *)mrb_realloc(mrb, a->ptr, sizeof(mrb_value)*a->len+1); + } + else { + shared->ptr = a->ptr; + } + shared->len = a->len; + a->aux.shared = shared; + a->flags |= MRB_ARY_SHARED; + } +} + +static void +ary_expand_capa(mrb_state *mrb, struct RArray *a, int len) +{ + int capa = a->aux.capa; + +#ifdef INT_MAX + if (len > ARY_MAX_SIZE) { + mrb_raise(mrb, E_ARGUMENT_ERROR, "array size too big"); + } +#endif + + while(capa < len) { + if (capa == 0) { + capa = ARY_DEFAULT_LEN; + } + else { + capa *= 2; + } + } + +#ifdef INT_MAX + if (capa > ARY_MAX_SIZE) capa = ARY_MAX_SIZE; /* len <= capa <= ARY_MAX_SIZE */ +#endif + + if (capa > a->aux.capa) { + a->aux.capa = capa; + a->ptr = (mrb_value *)mrb_realloc(mrb, a->ptr, sizeof(mrb_value)*capa); + } +} + +static void +ary_shrink_capa(mrb_state *mrb, struct RArray *a) +{ + int capa = a->aux.capa; + + if (capa < ARY_DEFAULT_LEN * 2) return; + if (capa <= a->len * ARY_SHRINK_RATIO) return; + + do { + capa /= 2; + if (capa < ARY_DEFAULT_LEN) { + capa = ARY_DEFAULT_LEN; + break; + } + } while(capa > a->len * ARY_SHRINK_RATIO); + + if (capa > a->len && capa < a->aux.capa) { + a->aux.capa = capa; + a->ptr = (mrb_value *)mrb_realloc(mrb, a->ptr, sizeof(mrb_value)*capa); + } +} + +mrb_value +mrb_ary_s_create(mrb_state *mrb, mrb_value self) +{ + mrb_value *vals; + int len; + + mrb_get_args(mrb, "*", &vals, &len); + return mrb_ary_new_from_values(mrb, (int)len, vals); +} + +static void +ary_concat(mrb_state *mrb, struct RArray *a, mrb_value *ptr, int blen) +{ + int len = a->len + blen; + + ary_modify(mrb, a); + if (a->aux.capa < len) ary_expand_capa(mrb, a, len); + array_copy(a->ptr+a->len, ptr, blen); + mrb_write_barrier(mrb, (struct RBasic*)a); + a->len = len; +} + +void +mrb_ary_concat(mrb_state *mrb, mrb_value self, mrb_value other) +{ + struct RArray *a2 = mrb_ary_ptr(other); + + ary_concat(mrb, mrb_ary_ptr(self), a2->ptr, a2->len); +} + +mrb_value +mrb_ary_concat_m(mrb_state *mrb, mrb_value self) +{ + mrb_value *ptr; + int blen; + + mrb_get_args(mrb, "a", &ptr, &blen); + ary_concat(mrb, mrb_ary_ptr(self), ptr, blen); + return self; +} + +mrb_value +mrb_ary_plus(mrb_state *mrb, mrb_value self) +{ + struct RArray *a1 = mrb_ary_ptr(self); + struct RArray *a2; + mrb_value ary; + mrb_value *ptr; + int blen; + + mrb_get_args(mrb, "a", &ptr, &blen); + ary = mrb_ary_new_capa(mrb, a1->len + blen); + a2 = mrb_ary_ptr(ary); + array_copy(a2->ptr, a1->ptr, a1->len); + array_copy(a2->ptr + a1->len, ptr, blen); + a2->len = a1->len + blen; + + return ary; +} + +/* + * call-seq: + * ary <=> other_ary -> -1, 0, +1 or nil + * + * Comparison---Returns an integer (-1, 0, or +1) + * if this array is less than, equal to, or greater than <i>other_ary</i>. + * Each object in each array is compared (using <=>). If any value isn't + * equal, then that inequality is the return value. If all the + * values found are equal, then the return is based on a + * comparison of the array lengths. Thus, two arrays are + * ``equal'' according to <code>Array#<=></code> if and only if they have + * the same length and the value of each element is equal to the + * value of the corresponding element in the other array. + * + * [ "a", "a", "c" ] <=> [ "a", "b", "c" ] #=> -1 + * [ 1, 2, 3, 4, 5, 6 ] <=> [ 1, 2 ] #=> +1 + * + */ +mrb_value +mrb_ary_cmp(mrb_state *mrb, mrb_value ary1) +{ + mrb_value ary2; + struct RArray *a1, *a2; + mrb_value r = mrb_nil_value(); + int i, len; + + mrb_get_args(mrb, "o", &ary2); + if (!mrb_array_p(ary2)) return mrb_nil_value(); + a1 = RARRAY(ary1); a2 = RARRAY(ary2); + if (a1->len == a2->len && a1->ptr == a2->ptr) return mrb_fixnum_value(0); + else { + mrb_sym cmp = mrb_intern(mrb, "<=>"); + + len = RARRAY_LEN(ary1); + if (len > RARRAY_LEN(ary2)) { + len = RARRAY_LEN(ary2); + } + for (i=0; i<len; i++) { + mrb_value v = ary_elt(ary2, i); + r = mrb_funcall_argv(mrb, ary_elt(ary1, i), cmp, 1, &v); + if (mrb_type(r) != MRB_TT_FIXNUM || mrb_fixnum(r) != 0) return r; + } + } + len = a1->len - a2->len; + return mrb_fixnum_value((len == 0)? 0: (len > 0)? 1: -1); +} + +static void +ary_replace(mrb_state *mrb, struct RArray *a, mrb_value *argv, int len) +{ + ary_modify(mrb, a); + if (a->aux.capa < len) + ary_expand_capa(mrb, a, len); + array_copy(a->ptr, argv, len); + mrb_write_barrier(mrb, (struct RBasic*)a); + a->len = len; +} + +void +mrb_ary_replace(mrb_state *mrb, mrb_value self, mrb_value other) +{ + struct RArray *a2 = mrb_ary_ptr(other); + + ary_replace(mrb, mrb_ary_ptr(self), a2->ptr, a2->len); +} + +mrb_value +mrb_ary_replace_m(mrb_state *mrb, mrb_value self) +{ + mrb_value other; + + mrb_get_args(mrb, "A", &other); + mrb_ary_replace(mrb, self, other); + + return self; +} + +mrb_value +mrb_ary_times(mrb_state *mrb, mrb_value self) +{ + struct RArray *a1 = mrb_ary_ptr(self); + struct RArray *a2; + mrb_value ary; + mrb_value *ptr; + mrb_int times; + + mrb_get_args(mrb, "i", ×); + if (times < 0) { + mrb_raise(mrb, E_ARGUMENT_ERROR, "negative argument"); + } + if (times == 0) return mrb_ary_new(mrb); + + ary = mrb_ary_new_capa(mrb, a1->len * times); + a2 = mrb_ary_ptr(ary); + ptr = a2->ptr; + while(times--) { + array_copy(ptr, a1->ptr, a1->len); + ptr += a1->len; + a2->len += a1->len; + } + + return ary; +} + +mrb_value +mrb_ary_reverse_bang(mrb_state *mrb, mrb_value self) +{ + struct RArray *a = mrb_ary_ptr(self); + + if (a->len > 1) { + mrb_value *p1, *p2; + + ary_modify(mrb, a); + p1 = a->ptr; + p2 = a->ptr + a->len - 1; + + while(p1 < p2) { + mrb_value tmp = *p1; + *p1++ = *p2; + *p2-- = tmp; + } + } + return self; +} + +mrb_value +mrb_ary_reverse(mrb_state *mrb, mrb_value self) +{ + struct RArray *a = mrb_ary_ptr(self), *b; + mrb_value ary; + + ary = mrb_ary_new_capa(mrb, a->len); + b = mrb_ary_ptr(ary); + if (a->len > 0) { + mrb_value *p1, *p2, *e; + + p1 = a->ptr; + e = p1 + a->len; + p2 = b->ptr + a->len - 1; + while(p1 < e) { + *p2-- = *p1++; + } + b->len = a->len; + } + return ary; +} + +mrb_value +mrb_ary_new4(mrb_state *mrb, int n, const mrb_value *elts) +{ + mrb_value ary; + + ary = mrb_ary_new_capa(mrb, n); + if (n > 0 && elts) { + array_copy(RARRAY_PTR(ary), elts, n); + RARRAY_LEN(ary) = n; + } + + return ary; +} + +mrb_value +mrb_ary_new_elts(mrb_state *mrb, int n, const mrb_value *elts) +{ + return mrb_ary_new4(mrb, n, elts); +} + +void +mrb_ary_push(mrb_state *mrb, mrb_value ary, mrb_value elem) /* mrb_ary_push */ +{ + struct RArray *a = mrb_ary_ptr(ary); + + ary_modify(mrb, a); + if (a->len == a->aux.capa) + ary_expand_capa(mrb, a, a->len + 1); + a->ptr[a->len++] = elem; + mrb_write_barrier(mrb, (struct RBasic*)a); +} + +mrb_value +mrb_ary_push_m(mrb_state *mrb, mrb_value self) +{ + mrb_value *argv; + int len; + + mrb_get_args(mrb, "*", &argv, &len); + while(len--) { + mrb_ary_push(mrb, self, *argv++); + } + + return self; +} + +mrb_value +mrb_ary_pop(mrb_state *mrb, mrb_value ary) +{ + struct RArray *a = mrb_ary_ptr(ary); + + if (a->len == 0) return mrb_nil_value(); + return a->ptr[--a->len]; +} + +#define ARY_SHIFT_SHARED_MIN 10 + +mrb_value +mrb_ary_shift(mrb_state *mrb, mrb_value self) +{ + struct RArray *a = mrb_ary_ptr(self); + mrb_value val; + + if (a->len == 0) return mrb_nil_value(); + if (a->flags & MRB_ARY_SHARED) { + L_SHIFT: + val = a->ptr[0]; + a->ptr++; + a->len--; + return val; + } + if (a->len > ARY_SHIFT_SHARED_MIN) { + ary_make_shared(mrb, a); + goto L_SHIFT; + } + else { + mrb_value *ptr = a->ptr; + int size = a->len; + + val = *ptr; + while((int)(--size)) { + *ptr = *(ptr+1); + ++ptr; + } + --a->len; + } + return val; +} + +/* self = [1,2,3] + item = 0 + self.unshift item + p self #=> [0, 1, 2, 3] */ +mrb_value +mrb_ary_unshift(mrb_state *mrb, mrb_value self, mrb_value item) +{ + struct RArray *a = mrb_ary_ptr(self); + + if ((a->flags & MRB_ARY_SHARED) + && a->aux.shared->refcnt == 1 /* shared only referenced from this array */ + && a->ptr - a->aux.shared->ptr >= 1) /* there's room for unshifted item */ { + a->ptr--; + a->ptr[0] = item; + } + else { + ary_modify(mrb, a); + if (a->aux.capa < a->len + 1) + ary_expand_capa(mrb, a, a->len + 1); + memmove(a->ptr + 1, a->ptr, sizeof(mrb_value)*a->len); + a->ptr[0] = item; + } + a->len++; + mrb_write_barrier(mrb, (struct RBasic*)a); + + return self; +} + +mrb_value +mrb_ary_unshift_m(mrb_state *mrb, mrb_value self) +{ + struct RArray *a = mrb_ary_ptr(self); + mrb_value *vals; + int len; + + mrb_get_args(mrb, "*", &vals, &len); + if ((a->flags & MRB_ARY_SHARED) + && a->aux.shared->refcnt == 1 /* shared only referenced from this array */ + && a->ptr - a->aux.shared->ptr >= len) /* there's room for unshifted item */ { + a->ptr -= len; + } + else { + ary_modify(mrb, a); + if (len == 0) return self; + if (a->aux.capa < a->len + len) + ary_expand_capa(mrb, a, a->len + len); + memmove(a->ptr + len, a->ptr, sizeof(mrb_value)*a->len); + } + array_copy(a->ptr, vals, len); + a->len += len; + mrb_write_barrier(mrb, (struct RBasic*)a); + + return self; +} + +mrb_value +mrb_ary_ref(mrb_state *mrb, mrb_value ary, mrb_int n) +{ + struct RArray *a = mrb_ary_ptr(ary); + + /* range check */ + if (n < 0) n += a->len; + if (n < 0 || a->len <= (int)n) return mrb_nil_value(); + + return a->ptr[n]; +} + +void +mrb_ary_set(mrb_state *mrb, mrb_value ary, mrb_int n, mrb_value val) /* rb_ary_store */ +{ + struct RArray *a = mrb_ary_ptr(ary); + + ary_modify(mrb, a); + /* range check */ + if (n < 0) { + n += a->len; + if (n < 0) { + mrb_raisef(mrb, E_INDEX_ERROR, "index %ld out of array", n - a->len); + } + } + if (a->len <= (int)n) { + if (a->aux.capa <= (int)n) + ary_expand_capa(mrb, a, n + 1); + ary_fill_with_nil(a->ptr + a->len, n + 1 - a->len); + a->len = n + 1; + } + + a->ptr[n] = val; + mrb_write_barrier(mrb, (struct RBasic*)a); +} + +mrb_value +mrb_ary_splice(mrb_state *mrb, mrb_value ary, mrb_int head, mrb_int len, mrb_value rpl) +{ + struct RArray *a = mrb_ary_ptr(ary); + int tail, size; + mrb_value *argv; + int i, argc; + + ary_modify(mrb, a); + /* range check */ + if (head < 0) { + head += a->len; + if (head < 0) { + mrb_raise(mrb, E_INDEX_ERROR, "index is out of array"); + } + } + if (a->len < len || a->len < head + len) { + len = a->len - head; + } + tail = head + len; + + /* size check */ + if (mrb_array_p(rpl)) { + argc = RARRAY_LEN(rpl); + argv = RARRAY_PTR(rpl); + } + else { + argc = 1; + argv = &rpl; + } + size = head + argc; + + if (tail < a->len) size += a->len - tail; + if (size > a->aux.capa) + ary_expand_capa(mrb, a, size); + + if (head > a->len) { + ary_fill_with_nil(a->ptr + a->len, (int)(head - a->len)); + } + else if (head < a->len) { + memmove(a->ptr + head + argc, a->ptr + tail, sizeof(mrb_value)*(a->len - tail)); + } + + for(i = 0; i < argc; i++) { + *(a->ptr + head + i) = *(argv + i); + } + + a->len = size; + + return ary; +} + +int +mrb_ary_alen(mrb_state *mrb, mrb_value ary) +{ + return RARRAY_LEN(ary); +} + +void +mrb_ary_decref(mrb_state *mrb, struct mrb_shared_array *shared) +{ + shared->refcnt--; + if (shared->refcnt == 0) { + mrb_free(mrb, shared->ptr); + mrb_free(mrb, shared); + } +} + +static mrb_value +ary_subseq(mrb_state *mrb, struct RArray *a, int beg, int len) +{ + struct RArray *b; + + ary_make_shared(mrb, a); + b = (struct RArray*)mrb_obj_alloc(mrb, MRB_TT_ARRAY, mrb->array_class); + b->ptr = a->ptr + beg; + b->len = len; + b->aux.shared = a->aux.shared; + b->aux.shared->refcnt++; + b->flags |= MRB_ARY_SHARED; + + return mrb_obj_value(b); +} + +mrb_value +mrb_ary_aget(mrb_state *mrb, mrb_value self) +{ + struct RArray *a = mrb_ary_ptr(self); + mrb_int index, len; + mrb_value *argv; + int size; + + mrb_get_args(mrb, "i*", &index, &argv, &size); + switch(size) { + case 0: + return mrb_ary_ref(mrb, self, index); + + case 1: + if (mrb_type(argv[0]) != MRB_TT_FIXNUM) { + mrb_raise(mrb, E_TYPE_ERROR, "expected Fixnum"); + } + if (index < 0) index += a->len; + if (index < 0 || a->len < (int)index) return mrb_nil_value(); + len = mrb_fixnum(argv[0]); + if (len < 0) return mrb_nil_value(); + if (a->len == (int)index) return mrb_ary_new(mrb); + if ((int)len > a->len - index) len = a->len - index; + return ary_subseq(mrb, a, index, len); + + default: + mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments"); + } + + return mrb_nil_value(); /* dummy to avoid warning : not reach here */ +} + +mrb_value +mrb_ary_aset(mrb_state *mrb, mrb_value self) +{ + mrb_value *argv; + int argc; + + mrb_get_args(mrb, "*", &argv, &argc); + switch(argc) { + case 2: + if (!mrb_fixnum_p(argv[0])) { + /* Should we support Range object for 1st arg ? */ + mrb_raise(mrb, E_TYPE_ERROR, "expected Fixnum for 1st argument"); + } + mrb_ary_set(mrb, self, mrb_fixnum(argv[0]), argv[1]); + return argv[1]; + + case 3: + mrb_ary_splice(mrb, self, mrb_fixnum(argv[0]), mrb_fixnum(argv[1]), argv[2]); + return argv[2]; + + default: + mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments"); + return mrb_nil_value(); + } +} + +mrb_value +mrb_ary_delete_at(mrb_state *mrb, mrb_value self) +{ + struct RArray *a = mrb_ary_ptr(self); + mrb_int index; + mrb_value val; + mrb_value *ptr; + int len; + + mrb_get_args(mrb, "i", &index); + if (index < 0) index += a->len; + if (index < 0 || a->len <= (int)index) return mrb_nil_value(); + + ary_modify(mrb, a); + val = a->ptr[index]; + + ptr = a->ptr + index; + len = a->len - index; + while((int)(--len)) { + *ptr = *(ptr+1); + ++ptr; + } + --a->len; + + ary_shrink_capa(mrb, a); + + return val; +} + +mrb_value +mrb_ary_first(mrb_state *mrb, mrb_value self) +{ + struct RArray *a = mrb_ary_ptr(self); + mrb_int size; + + if (mrb_get_args(mrb, "|i", &size) == 0) { + return (a->len > 0)? a->ptr[0]: mrb_nil_value(); + } + if (size < 0) { + mrb_raise(mrb, E_ARGUMENT_ERROR, "negative array size"); + } + + if (size > a->len) size = a->len; + if (a->flags & MRB_ARY_SHARED) { + return ary_subseq(mrb, a, 0, size); + } + return mrb_ary_new_from_values(mrb, size, a->ptr); +} + +mrb_value +mrb_ary_last(mrb_state *mrb, mrb_value self) +{ + struct RArray *a = mrb_ary_ptr(self); + int size; + mrb_value *vals; + int len; + + mrb_get_args(mrb, "*", &vals, &len); + if (len > 1) { + mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments"); + } + + if (len == 0) return (a->len > 0)? a->ptr[a->len - 1]: mrb_nil_value(); + + /* len == 1 */ + size = mrb_fixnum(*vals); + if (size < 0) { + mrb_raise(mrb, E_ARGUMENT_ERROR, "negative array size"); + } + if (size > a->len) size = a->len; + if ((a->flags & MRB_ARY_SHARED) || size > ARY_DEFAULT_LEN) { + return ary_subseq(mrb, a, a->len - size, size); + } + return mrb_ary_new_from_values(mrb, size, a->ptr + a->len - size); +} + +mrb_value +mrb_ary_index_m(mrb_state *mrb, mrb_value self) +{ + mrb_value obj; + int i; + + mrb_get_args(mrb, "o", &obj); + for (i = 0; i < RARRAY_LEN(self); i++) { + if (mrb_equal(mrb, RARRAY_PTR(self)[i], obj)) { + return mrb_fixnum_value(i); + } + } + return mrb_nil_value(); +} + +mrb_value +mrb_ary_rindex_m(mrb_state *mrb, mrb_value self) +{ + mrb_value obj; + int i; + + mrb_get_args(mrb, "o", &obj); + for (i = RARRAY_LEN(self) - 1; i >= 0; i--) { + if (mrb_equal(mrb, RARRAY_PTR(self)[i], obj)) { + return mrb_fixnum_value(i); + } + } + return mrb_nil_value(); +} + +mrb_value +mrb_ary_splat(mrb_state *mrb, mrb_value v) +{ + if (mrb_array_p(v)) { + return v; + } + else { + return mrb_ary_new_from_values(mrb, 1, &v); + } +} + +static mrb_value +mrb_ary_size(mrb_state *mrb, mrb_value self) +{ + struct RArray *a = mrb_ary_ptr(self); + + return mrb_fixnum_value(a->len); +} + +mrb_value +mrb_ary_clear(mrb_state *mrb, mrb_value self) +{ + struct RArray *a = mrb_ary_ptr(self); + + ary_modify(mrb, a); + a->len = 0; + a->aux.capa = 0; + mrb_free(mrb, a->ptr); + a->ptr = 0; + + return self; +} + +mrb_value +mrb_ary_empty_p(mrb_state *mrb, mrb_value self) +{ + struct RArray *a = mrb_ary_ptr(self); + + return ((a->len == 0)? mrb_true_value(): mrb_false_value()); +} + +mrb_value +mrb_check_array_type(mrb_state *mrb, mrb_value ary) +{ + return mrb_check_convert_type(mrb, ary, MRB_TT_ARRAY, "Array", "to_ary"); +} + +mrb_value +mrb_ary_entry(mrb_value ary, int offset) +{ + if (offset < 0) { + offset += RARRAY_LEN(ary); + } + return ary_elt(ary, offset); +} + +static mrb_value +inspect_ary(mrb_state *mrb, mrb_value ary, mrb_value list) +{ + int i; + mrb_value s, arystr; + char head[] = { '[' }; + char sep[] = { ',', ' ' }; + char tail[] = { ']' }; + + /* check recursive */ + for(i=0; i<RARRAY_LEN(list); i++) { + if (mrb_obj_equal(mrb, ary, RARRAY_PTR(list)[i])) { + return mrb_str_new(mrb, "[...]", 5); + } + } + + mrb_ary_push(mrb, list, ary); + + arystr = mrb_str_buf_new(mrb, 64); + mrb_str_buf_cat(mrb, arystr, head, sizeof(head)); + + for(i=0; i<RARRAY_LEN(ary); i++) { + int ai = mrb_gc_arena_save(mrb); + + if (i > 0) { + mrb_str_buf_cat(mrb, arystr, sep, sizeof(sep)); + } + if (mrb_array_p(RARRAY_PTR(ary)[i])) { + s = inspect_ary(mrb, RARRAY_PTR(ary)[i], list); + } else { + s = mrb_inspect(mrb, RARRAY_PTR(ary)[i]); + } + mrb_str_buf_cat(mrb, arystr, RSTRING_PTR(s), RSTRING_LEN(s)); + mrb_gc_arena_restore(mrb, ai); + } + + mrb_str_buf_cat(mrb, arystr, tail, sizeof(tail)); + mrb_ary_pop(mrb, list); + + return arystr; +} + +/* 15.2.12.5.31 (x) */ +/* + * call-seq: + * ary.to_s -> string + * ary.inspect -> string + * + * Creates a string representation of +self+. + */ + +static mrb_value +mrb_ary_inspect(mrb_state *mrb, mrb_value ary) +{ + if (RARRAY_LEN(ary) == 0) return mrb_str_new(mrb, "[]", 2); + #if 0 /* THREAD */ + return mrb_exec_recursive(inspect_ary_r, ary, 0); + #else + return inspect_ary(mrb, ary, mrb_ary_new(mrb)); + #endif +} + +static mrb_value +join_ary(mrb_state *mrb, mrb_value ary, mrb_value sep, mrb_value list) +{ + int i; + mrb_value result, val, tmp; + + /* check recursive */ + for(i=0; i<RARRAY_LEN(list); i++) { + if (mrb_obj_equal(mrb, ary, RARRAY_PTR(list)[i])) { + mrb_raise(mrb, E_ARGUMENT_ERROR, "recursive array join"); + } + } + + mrb_ary_push(mrb, list, ary); + + result = mrb_str_buf_new(mrb, 64); + + for(i=0; i<RARRAY_LEN(ary); i++) { + if (i > 0 && !mrb_nil_p(sep)) { + mrb_str_buf_cat(mrb, result, RSTRING_PTR(sep), RSTRING_LEN(sep)); + } + + val = RARRAY_PTR(ary)[i]; + switch(mrb_type(val)) { + case MRB_TT_ARRAY: + ary_join: + val = join_ary(mrb, val, sep, list); + /* fall through */ + + case MRB_TT_STRING: + str_join: + mrb_str_buf_cat(mrb, result, RSTRING_PTR(val), RSTRING_LEN(val)); + break; + + default: + tmp = mrb_check_string_type(mrb, val); + if (!mrb_nil_p(tmp)) { + val = tmp; + goto str_join; + } + tmp = mrb_check_convert_type(mrb, val, MRB_TT_ARRAY, "Array", "to_ary"); + if (!mrb_nil_p(tmp)) { + val = tmp; + goto ary_join; + } + val = mrb_obj_as_string(mrb, val); + goto str_join; + } + } + + mrb_ary_pop(mrb, list); + + return result; +} + +mrb_value +mrb_ary_join(mrb_state *mrb, mrb_value ary, mrb_value sep) +{ + sep = mrb_obj_as_string(mrb, sep); + return join_ary(mrb, ary, sep, mrb_ary_new(mrb)); +} + +/* + * call-seq: + * ary.join(sep="") -> str + * + * Returns a string created by converting each element of the array to + * a string, separated by <i>sep</i>. + * + * [ "a", "b", "c" ].join #=> "abc" + * [ "a", "b", "c" ].join("-") #=> "a-b-c" + */ + +static mrb_value +mrb_ary_join_m(mrb_state *mrb, mrb_value ary) +{ + mrb_value sep = mrb_nil_value(); + + mrb_get_args(mrb, "|S", &sep); + return mrb_ary_join(mrb, ary, sep); +} + +/* 15.2.12.5.33 (x) */ +/* + * call-seq: + * ary == other_ary -> bool + * + * Equality---Two arrays are equal if they contain the same number + * of elements and if each element is equal to (according to + * Object.==) the corresponding element in the other array. + * + * [ "a", "c" ] == [ "a", "c", 7 ] #=> false + * [ "a", "c", 7 ] == [ "a", "c", 7 ] #=> true + * [ "a", "c", 7 ] == [ "a", "d", "f" ] #=> false + * + */ + +static mrb_value +mrb_ary_equal(mrb_state *mrb, mrb_value ary1) +{ + mrb_value ary2; + + mrb_get_args(mrb, "o", &ary2); + if (mrb_obj_equal(mrb, ary1, ary2)) return mrb_true_value(); + if (mrb_special_const_p(ary2)) return mrb_false_value(); + if (!mrb_array_p(ary2)) { + if (!mrb_respond_to(mrb, ary2, mrb_intern(mrb, "to_ary"))) { + return mrb_false_value(); + } + if (mrb_equal(mrb, ary2, ary1)){ + return mrb_true_value(); + } + else { + return mrb_false_value(); + } + } + if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return mrb_false_value(); + else { + int i; + + for (i=0; i<RARRAY_LEN(ary1); i++) { + if (!mrb_equal(mrb, ary_elt(ary1, i), ary_elt(ary2, i))) + return mrb_false_value(); + } + return mrb_true_value(); + } +} + +/* 15.2.12.5.34 (x) */ +/* + * call-seq: + * ary.eql?(other) -> true or false + * + * Returns <code>true</code> if +self+ and _other_ are the same object, + * or are both arrays with the same content. + */ + +static mrb_value +mrb_ary_eql(mrb_state *mrb, mrb_value ary1) +{ + mrb_value ary2; + + mrb_get_args(mrb, "o", &ary2); + if (mrb_obj_equal(mrb, ary1, ary2)) return mrb_true_value(); + if (!mrb_array_p(ary2)) return mrb_false_value(); + if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return mrb_false_value(); + else { + int i; + + for (i=0; i<RARRAY_LEN(ary1); i++) { + if (!mrb_eql(mrb, ary_elt(ary1, i), ary_elt(ary2, i))) + return mrb_false_value(); + } + return mrb_true_value(); + } +} + +void +mrb_init_array(mrb_state *mrb) +{ + struct RClass *a; + + a = mrb->array_class = mrb_define_class(mrb, "Array", mrb->object_class); + MRB_SET_INSTANCE_TT(a, MRB_TT_ARRAY); + mrb_include_module(mrb, a, mrb_class_get(mrb, "Enumerable")); + + mrb_define_class_method(mrb, a, "[]", mrb_ary_s_create, ARGS_ANY()); /* 15.2.12.4.1 */ + + mrb_define_method(mrb, a, "*", mrb_ary_times, ARGS_REQ(1)); /* 15.2.12.5.1 */ + mrb_define_method(mrb, a, "+", mrb_ary_plus, ARGS_REQ(1)); /* 15.2.12.5.2 */ + mrb_define_method(mrb, a, "<<", mrb_ary_push_m, ARGS_REQ(1)); /* 15.2.12.5.3 */ + mrb_define_method(mrb, a, "[]", mrb_ary_aget, ARGS_ANY()); /* 15.2.12.5.4 */ + mrb_define_method(mrb, a, "[]=", mrb_ary_aset, ARGS_ANY()); /* 15.2.12.5.5 */ + mrb_define_method(mrb, a, "clear", mrb_ary_clear, ARGS_NONE()); /* 15.2.12.5.6 */ + mrb_define_method(mrb, a, "concat", mrb_ary_concat_m, ARGS_REQ(1)); /* 15.2.12.5.8 */ + mrb_define_method(mrb, a, "delete_at", mrb_ary_delete_at, ARGS_REQ(1)); /* 15.2.12.5.9 */ + mrb_define_method(mrb, a, "empty?", mrb_ary_empty_p, ARGS_NONE()); /* 15.2.12.5.12 */ + mrb_define_method(mrb, a, "first", mrb_ary_first, ARGS_OPT(1)); /* 15.2.12.5.13 */ + mrb_define_method(mrb, a, "index", mrb_ary_index_m, ARGS_REQ(1)); /* 15.2.12.5.14 */ + mrb_define_method(mrb, a, "initialize_copy", mrb_ary_replace_m, ARGS_REQ(1)); /* 15.2.12.5.16 */ + mrb_define_method(mrb, a, "join", mrb_ary_join_m, ARGS_ANY()); /* 15.2.12.5.17 */ + mrb_define_method(mrb, a, "last", mrb_ary_last, ARGS_ANY()); /* 15.2.12.5.18 */ + mrb_define_method(mrb, a, "length", mrb_ary_size, ARGS_NONE()); /* 15.2.12.5.19 */ + mrb_define_method(mrb, a, "pop", mrb_ary_pop, ARGS_NONE()); /* 15.2.12.5.21 */ + mrb_define_method(mrb, a, "push", mrb_ary_push_m, ARGS_ANY()); /* 15.2.12.5.22 */ + mrb_define_method(mrb, a, "replace", mrb_ary_replace_m, ARGS_REQ(1)); /* 15.2.12.5.23 */ + mrb_define_method(mrb, a, "reverse", mrb_ary_reverse, ARGS_NONE()); /* 15.2.12.5.24 */ + mrb_define_method(mrb, a, "reverse!", mrb_ary_reverse_bang, ARGS_NONE()); /* 15.2.12.5.25 */ + mrb_define_method(mrb, a, "rindex", mrb_ary_rindex_m, ARGS_REQ(1)); /* 15.2.12.5.26 */ + mrb_define_method(mrb, a, "shift", mrb_ary_shift, ARGS_NONE()); /* 15.2.12.5.27 */ + mrb_define_method(mrb, a, "size", mrb_ary_size, ARGS_NONE()); /* 15.2.12.5.28 */ + mrb_define_method(mrb, a, "slice", mrb_ary_aget, ARGS_ANY()); /* 15.2.12.5.29 */ + mrb_define_method(mrb, a, "unshift", mrb_ary_unshift_m, ARGS_ANY()); /* 15.2.12.5.30 */ + + mrb_define_method(mrb, a, "inspect", mrb_ary_inspect, ARGS_NONE()); /* 15.2.12.5.31 (x) */ + mrb_define_alias(mrb, a, "to_s", "inspect"); /* 15.2.12.5.32 (x) */ + mrb_define_method(mrb, a, "==", mrb_ary_equal, ARGS_REQ(1)); /* 15.2.12.5.33 (x) */ + mrb_define_method(mrb, a, "eql?", mrb_ary_eql, ARGS_REQ(1)); /* 15.2.12.5.34 (x) */ + mrb_define_method(mrb, a, "<=>", mrb_ary_cmp, ARGS_REQ(1)); /* 15.2.12.5.36 (x) */ +} Added: vendor/mruby-b5830ae/src/cdump.c (+212 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/cdump.c 2013-01-09 13:19:18 +0900 (89ae0bb) @@ -0,0 +1,212 @@ +/* +** cdump.c - mruby binary dumper (C source format) +** +** See Copyright Notice in mruby.h +*/ + +#include "mruby/cdump.h" + +#include <string.h> + +#include "mruby/irep.h" +#include "mruby/string.h" + +#define MRB_CDUMP_LINE_LEN 128 + +#define SOURCE_CODE(fmt, ...) fprintf(f, fmt"\n", __VA_ARGS__) +#define SOURCE_CODE0(str) do {fputs(str, f); putc('\n', f);} while (0) + +static int +make_cdump_isec(mrb_state *mrb, int irep_no, FILE *f) +{ + int i; + mrb_irep *irep = mrb->irep[irep_no]; + + if (irep == NULL) + return -1; + + /* dump isec struct*/ + if (irep->ilen > 0) { + SOURCE_CODE ("static mrb_code iseq_%d[] = {", irep_no); + for (i=0; i<irep->ilen; i++) + SOURCE_CODE(" 0x%08x," , irep->iseq[i]); + SOURCE_CODE0 ("};"); + SOURCE_CODE0 (""); + } + + return 0; +} + +static size_t +str_format_len(mrb_value str) +{ + size_t dump_len = 0; + + char *src; + + for (src = RSTRING_PTR(str); src < RSTRING_END(str); src++) { + switch (*src) { + case 0x07:/* BEL */ /* fall through */ + case 0x08:/* BS */ /* fall through */ + case 0x09:/* HT */ /* fall through */ + case 0x0A:/* LF */ /* fall through */ + case 0x0B:/* VT */ /* fall through */ + case 0x0C:/* FF */ /* fall through */ + case 0x0D:/* CR */ /* fall through */ + case 0x22:/* " */ /* fall through */ + case 0x27:/* ' */ /* fall through */ + case 0x3F:/* ? */ /* fall through */ + case 0x5C:/* \ */ /* fall through */ + dump_len += 2; + break; + + default: + dump_len++; + break; + } + } + + return dump_len; +} + +static char* +str_to_format(mrb_value str, char *buf) +{ + char *src; + char *dst; + + for (src = RSTRING_PTR(str), dst = buf; src < RSTRING_END(str); src++) { + switch (*src) { + case 0x07:/* BEL */ *dst++ = '\\'; *dst++ = 'a'; break; + case 0x08:/* BS */ *dst++ = '\\'; *dst++ = 'b'; break; + case 0x09:/* HT */ *dst++ = '\\'; *dst++ = 't'; break; + case 0x0A:/* LF */ *dst++ = '\\'; *dst++ = 'n'; break; + case 0x0B:/* VT */ *dst++ = '\\'; *dst++ = 'v'; break; + case 0x0C:/* FF */ *dst++ = '\\'; *dst++ = 'f'; break; + case 0x0D:/* CR */ *dst++ = '\\'; *dst++ = 'r'; break; + case 0x22:/* " */ *dst++ = '\\'; *dst++ = '\"'; break; + case 0x27:/* ' */ *dst++ = '\\'; *dst++ = '\''; break; + case 0x3F:/* ? */ *dst++ = '\\'; *dst++ = '\?'; break; + case 0x5C:/* \ */ *dst++ = '\\'; *dst++ = '\\'; break; + default: *dst++ = *src; break; + } + } + + return buf; +} + +int +make_cdump_irep(mrb_state *mrb, int irep_no, FILE *f) +{ + mrb_irep *irep = mrb->irep[irep_no]; + int n; + char *buf = 0; + size_t buf_len, str_len; + + if (irep == NULL) + return -1; + + buf_len = MRB_CDUMP_LINE_LEN; + if ((buf = (char *)mrb_malloc(mrb, buf_len)) == NULL) { + return MRB_CDUMP_GENERAL_FAILURE; + } + + SOURCE_CODE0 (" ai = mrb->arena_idx;"); + SOURCE_CODE0 (" irep = mrb_add_irep(mrb);"); + SOURCE_CODE0 (" irep->flags = MRB_ISEQ_NO_FREE;"); + SOURCE_CODE (" irep->nlocals = %d;", irep->nlocals); + SOURCE_CODE (" irep->nregs = %d;", irep->nregs); + SOURCE_CODE (" irep->ilen = %d;", irep->ilen); + SOURCE_CODE (" irep->iseq = iseq_%d;", irep_no); + + SOURCE_CODE (" irep->slen = %d;", irep->slen); + if(irep->slen > 0) { + SOURCE_CODE (" irep->syms = mrb_malloc(mrb, sizeof(mrb_sym)*%d);", irep->slen); + for (n=0; n<irep->slen; n++) + if (irep->syms[n]) { + const char *name; + int len; + + name = mrb_sym2name_len(mrb, irep->syms[n], &len); + SOURCE_CODE (" irep->syms[%d] = mrb_intern2(mrb, \"%s\", %d);", n, name, len); + } + } + else + SOURCE_CODE0 (" irep->syms = NULL;"); + + SOURCE_CODE0 (" irep->pool = NULL;"); + SOURCE_CODE0 (" irep->lines = NULL;"); + SOURCE_CODE0 (" mrb->irep_len = idx;"); + SOURCE_CODE0 (" irep->plen = 0;"); + if(irep->plen > 0) { + SOURCE_CODE (" irep->pool = mrb_malloc(mrb, sizeof(mrb_value)*%d);", irep->plen); + for (n=0; n<irep->plen; n++) { + switch (mrb_type(irep->pool[n])) { + case MRB_TT_FLOAT: + SOURCE_CODE(" irep->pool[%d] = mrb_float_value(%.16e);", n, mrb_float(irep->pool[n])); break; + case MRB_TT_FIXNUM: + SOURCE_CODE(" irep->pool[%d] = mrb_fixnum_value(%d);", n, mrb_fixnum(irep->pool[n])); break; + case MRB_TT_STRING: + str_len = str_format_len(irep->pool[n]) + 1; + if ( str_len > buf_len ) { + buf_len = str_len; + if ((buf = (char *)mrb_realloc(mrb, buf, buf_len)) == NULL) { + return MRB_CDUMP_GENERAL_FAILURE; + } + } + memset(buf, 0, buf_len); + SOURCE_CODE(" irep->pool[%d] = mrb_str_new(mrb, \"%s\", %d);", n, str_to_format(irep->pool[n], buf), RSTRING_LEN(irep->pool[n])); + SOURCE_CODE0 (" mrb->arena_idx = ai;"); + break; + /* TODO MRB_TT_REGEX */ + default: break; + } + SOURCE_CODE0(" irep->plen++;"); + } + } + else + SOURCE_CODE0(""); + + if (buf) + mrb_free(mrb, buf); + + return MRB_CDUMP_OK; +} + +int +mrb_cdump_irep(mrb_state *mrb, int n, FILE *f,const char *initname) +{ + int irep_no; + + if (mrb == NULL || n < 0 || n >= mrb->irep_len || f == NULL || initname == NULL) + return -1; + + SOURCE_CODE0("#include \"mruby.h\""); + SOURCE_CODE0("#include \"mruby/irep.h\""); + SOURCE_CODE0("#include \"mruby/string.h\""); + SOURCE_CODE0("#include \"mruby/proc.h\""); + SOURCE_CODE0(""); + + for (irep_no=n; irep_no<mrb->irep_len; irep_no++) { + if (make_cdump_isec(mrb, irep_no, f) != 0) + return -1; + } + + SOURCE_CODE0("void"); + SOURCE_CODE ("%s(mrb_state *mrb)", initname); + SOURCE_CODE0("{"); + SOURCE_CODE0(" int n = mrb->irep_len;"); + SOURCE_CODE0(" int idx = n;"); + SOURCE_CODE0(" int ai;"); + SOURCE_CODE0(" mrb_irep *irep;"); + SOURCE_CODE0(""); + for (irep_no=n; irep_no<mrb->irep_len; irep_no++) { + if (make_cdump_irep(mrb, irep_no, f) != 0) + return -1; + } + + SOURCE_CODE0(" mrb_run(mrb, mrb_proc_new(mrb, mrb->irep[n]), mrb_top_self(mrb));"); + SOURCE_CODE0("}"); + + return 0; +} Added: vendor/mruby-b5830ae/src/class.c (+1814 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/class.c 2013-01-09 13:19:18 +0900 (ea0db2b) @@ -0,0 +1,1814 @@ +/* +** class.c - Class class +** +** See Copyright Notice in mruby.h +*/ + +#include "mruby.h" +#include <stdarg.h> +#include <stdio.h> +#include <ctype.h> +#include "mruby/class.h" +#include "mruby/proc.h" +#include "mruby/string.h" +#include "mruby/numeric.h" +#include "mruby/variable.h" +#include "mruby/array.h" +#include "error.h" + +KHASH_DEFINE(mt, mrb_sym, struct RProc*, 1, kh_int_hash_func, kh_int_hash_equal) + +typedef struct fc_result { + mrb_sym name; + struct RClass * klass; + mrb_value path; + struct RClass * track; + struct fc_result *prev; +} fcresult_t; + +void +mrb_gc_mark_mt(mrb_state *mrb, struct RClass *c) +{ + khiter_t k; + khash_t(mt) *h = c->mt; + + if (!h) return; + for (k = kh_begin(h); k != kh_end(h); k++) { + if (kh_exist(h, k)){ + struct RProc *m = kh_value(h, k); + if (m) { + mrb_gc_mark(mrb, (struct RBasic*)m); + } + } + } +} + +size_t +mrb_gc_mark_mt_size(mrb_state *mrb, struct RClass *c) +{ + khash_t(mt) *h = c->mt; + + if (!h) return 0; + return kh_size(h); +} + +void +mrb_gc_free_mt(mrb_state *mrb, struct RClass *c) +{ + kh_destroy(mt, c->mt); +} + +void +mrb_name_class(mrb_state *mrb, struct RClass *c, mrb_sym name) +{ + mrb_obj_iv_set(mrb, (struct RObject*)c, + mrb_intern(mrb, "__classid__"), mrb_symbol_value(name)); +} + +#define make_metaclass(mrb, c) prepare_singleton_class((mrb), (struct RBasic*)(c)) + +static void +prepare_singleton_class(mrb_state *mrb, struct RBasic *o) +{ + struct RClass *sc, *c; + + if (o->c->tt == MRB_TT_SCLASS) return; + sc = (struct RClass*)mrb_obj_alloc(mrb, MRB_TT_SCLASS, mrb->class_class); + sc->mt = 0; + sc->iv = 0; + if (o->tt == MRB_TT_CLASS) { + c = (struct RClass*)o; + if (!c->super) { + sc->super = mrb->class_class; + } + else { + sc->super = c->super->c; + } + } + else if (o->tt == MRB_TT_SCLASS) { + c = (struct RClass*)o; + make_metaclass(mrb, c->super); + sc->super = c->super->c; + } + else { + sc->super = o->c; + } + o->c = sc; + mrb_field_write_barrier(mrb, (struct RBasic*)o, (struct RBasic*)sc); + mrb_field_write_barrier(mrb, (struct RBasic*)sc, (struct RBasic*)o); + mrb_obj_iv_set(mrb, (struct RObject*)sc, mrb_intern(mrb, "__attached__"), mrb_obj_value(o)); +} + +struct RClass* +mrb_define_module_id(mrb_state *mrb, mrb_sym name) +{ + struct RClass *m = mrb_module_new(mrb); + + mrb_obj_iv_set(mrb, (struct RObject*)mrb->object_class, + name, mrb_obj_value(m)); + mrb_name_class(mrb, m, name); + + return m; +} + +struct RClass* +mrb_define_module(mrb_state *mrb, const char *name) +{ + return mrb_define_module_id(mrb, mrb_intern(mrb, name)); +} + +static void +setup_class(mrb_state *mrb, mrb_value outer, struct RClass *c, mrb_sym id) +{ + mrb_name_class(mrb, c, id); + mrb_const_set(mrb, outer, id, mrb_obj_value(c)); + mrb_obj_iv_set(mrb, (struct RObject*)c, + mrb_intern(mrb, "__outer__"), outer); +} + +struct RClass* +mrb_class_outer_module(mrb_state *mrb, struct RClass *c) +{ + mrb_value outer; + + outer = mrb_obj_iv_get(mrb, (struct RObject*)c, mrb_intern(mrb, "__outer__")); + if (mrb_nil_p(outer)) return 0; + return mrb_class_ptr(outer); +} + +struct RClass* +mrb_vm_define_module(mrb_state *mrb, mrb_value outer, mrb_sym id) +{ + struct RClass *c; + mrb_value v; + + if (mrb_const_defined(mrb, outer, id)) { + v = mrb_const_get(mrb, outer, id); + c = mrb_class_ptr(v); + } + else { + c = mrb_module_new(mrb); + setup_class(mrb, outer, c, id); + } + return c; +} + +struct RClass* +mrb_define_class_id(mrb_state *mrb, mrb_sym name, struct RClass *super) +{ + struct RClass *c = mrb_class_new(mrb, super); + + mrb_obj_iv_set(mrb, (struct RObject*)mrb->object_class, + name, mrb_obj_value(c)); + mrb_name_class(mrb, c, name); + + return c; +} + +struct RClass* +mrb_define_class(mrb_state *mrb, const char *name, struct RClass *super) +{ + struct RClass *c; + c = mrb_define_class_id(mrb, mrb_intern(mrb, name), super); + return c; +} + +struct RClass* +mrb_vm_define_class(mrb_state *mrb, mrb_value outer, mrb_value super, mrb_sym id) +{ + struct RClass *c, *s; + + if (mrb_const_defined(mrb, outer, id)) { + mrb_value v = mrb_const_get(mrb, outer, id); + + mrb_check_type(mrb, v, MRB_TT_CLASS); + c = mrb_class_ptr(v); + if (!mrb_nil_p(super)) { + if (mrb_type(super) != MRB_TT_CLASS) { + mrb_raisef(mrb, E_TYPE_ERROR, "superclass must be a Class (%s given)", mrb_obj_classname(mrb, super)); + } + + if (!c->super || mrb_class_ptr(super) != mrb_class_real(c->super)) { + mrb_raisef(mrb, E_TYPE_ERROR, "superclass mismatch for class %s", mrb_sym2name(mrb, id)); + } + } + return c; + } + + if (!mrb_nil_p(super)) { + if (mrb_type(super) != MRB_TT_CLASS) { + mrb_raisef(mrb, E_TYPE_ERROR, "superclass must be a Class (%s given)", mrb_obj_classname(mrb, super)); + } + s = mrb_class_ptr(super); + } + else { + s = mrb->object_class; + } + + c = mrb_class_new(mrb, s); + setup_class(mrb, outer, c, id); + mrb_funcall(mrb, mrb_obj_value(s), "inherited", 1, mrb_obj_value(c)); + + return c; +} + +static struct RClass * +class_from_sym(mrb_state *mrb, struct RClass *klass, mrb_sym id) +{ + mrb_value c = mrb_const_get(mrb, mrb_obj_value(klass), id); + + if (mrb_type(c) != MRB_TT_MODULE && mrb_type(c) != MRB_TT_CLASS) { + mrb_raisef(mrb, E_TYPE_ERROR, "%s is not a class/module", mrb_sym2name(mrb, id)); + } + return mrb_class_ptr(c); +} + +struct RClass * +mrb_class_get(mrb_state *mrb, const char *name) +{ + return class_from_sym(mrb, mrb->object_class, mrb_intern(mrb, name)); +} + +/*! + * Defines a class under the namespace of \a outer. + * \param outer a class which contains the new class. + * \param id name of the new class + * \param super a class from which the new class will derive. + * NULL means \c Object class. + * \return the created class + * \throw TypeError if the constant name \a name is already taken but + * the constant is not a \c Class. + * \throw NameError if the class is already defined but the class can not + * be reopened because its superclass is not \a super. + * \post top-level constant named \a name refers the returned class. + * + * \note if a class named \a name is already defined and its superclass is + * \a super, the function just returns the defined class. + */ +struct RClass * +mrb_define_class_under(mrb_state *mrb, struct RClass *outer, const char *name, struct RClass *super) +{ + struct RClass * c; + mrb_sym id = mrb_intern(mrb, name); + + if (mrb_const_defined_at(mrb, outer, id)) { + c = class_from_sym(mrb, outer, id); + if (mrb_class_real(c->super) != super) { + mrb_name_error(mrb, id, "%s is already defined", mrb_sym2name(mrb, id)); + } + return c; + } + if (!super) { + mrb_warn("no super class for `%s::%s', Object assumed", + mrb_obj_classname(mrb, mrb_obj_value(outer)), mrb_sym2name(mrb, id)); + } + c = mrb_class_new(mrb, super); + setup_class(mrb, mrb_obj_value(outer), c, id); + + return c; +} + +struct RClass * +mrb_define_module_under(mrb_state *mrb, struct RClass *outer, const char *name) +{ + struct RClass * c; + mrb_sym id = mrb_intern(mrb, name); + + if (mrb_const_defined_at(mrb, outer, id)) { + c = class_from_sym(mrb, outer, id); + return c; + } + c = mrb_module_new(mrb); + setup_class(mrb, mrb_obj_value(outer), c, id); + + return c; +} + +void +mrb_define_method_raw(mrb_state *mrb, struct RClass *c, mrb_sym mid, struct RProc *p) +{ + khash_t(mt) *h = c->mt; + khiter_t k; + + if (!h) h = c->mt = kh_init(mt, mrb); + k = kh_put(mt, h, mid); + kh_value(h, k) = p; +} + +void +mrb_define_method_id(mrb_state *mrb, struct RClass *c, mrb_sym mid, mrb_func_t func, int aspec) +{ + struct RProc *p; + + p = mrb_proc_new_cfunc(mrb, func); + p->target_class = c; + mrb_define_method_raw(mrb, c, mid, p); +} + +void +mrb_define_method(mrb_state *mrb, struct RClass *c, const char *name, mrb_func_t func, int aspec) +{ + mrb_define_method_id(mrb, c, mrb_intern(mrb, name), func, aspec); +} + +void +mrb_define_method_vm(mrb_state *mrb, struct RClass *c, mrb_sym name, mrb_value body) +{ + khash_t(mt) *h = c->mt; + khiter_t k; + struct RProc *p; + + if (!h) h = c->mt = kh_init(mt, mrb); + k = kh_put(mt, h, name); + p = mrb_proc_ptr(body); + kh_value(h, k) = p; +} + +static mrb_value +check_type(mrb_state *mrb, mrb_value val, enum mrb_vtype t, const char *c, const char *m) +{ + mrb_value tmp; + + tmp = mrb_check_convert_type(mrb, val, t, c, m); + if (mrb_nil_p(tmp)) { + mrb_raisef(mrb, E_TYPE_ERROR, "expected %s", c); + } + return tmp; +} + +static mrb_value +to_str(mrb_state *mrb, mrb_value val) +{ + return check_type(mrb, val, MRB_TT_STRING, "String", "to_str"); +} + +static mrb_value +to_ary(mrb_state *mrb, mrb_value val) +{ + return check_type(mrb, val, MRB_TT_ARRAY, "Array", "to_ary"); +} + +static mrb_value +to_hash(mrb_state *mrb, mrb_value val) +{ + return check_type(mrb, val, MRB_TT_HASH, "Hash", "to_hash"); +} + +/* + retrieve arguments from mrb_state. + + mrb_get_args(mrb, format, ...) + + returns number of arguments parsed. + + fortmat specifiers: + + o: Object [mrb_value] + S: String [mrb_value] + A: Array [mrb_value] + H: Hash [mrb_value] + s: String [char*,int] + z: String [char*] + a: Array [mrb_value*,int] + f: Float [mrb_float] + i: Integer [mrb_int] + n: Symbol [mrb_sym] + &: Block [mrb_value] + *: rest argument [mrb_value*,int] + |: optional + */ +int +mrb_get_args(mrb_state *mrb, const char *format, ...) +{ + char c; + int i = 0; + mrb_value *sp = mrb->stack + 1; + va_list ap; + int argc = mrb->ci->argc; + int opt = 0; + + va_start(ap, format); + if (argc < 0) { + struct RArray *a = mrb_ary_ptr(mrb->stack[1]); + + argc = a->len; + sp = a->ptr; + } + while ((c = *format++)) { + switch (c) { + case '|': case '*': case '&': + break; + default: + if (argc <= i && !opt) { + mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments"); + } + } + + switch (c) { + case 'o': + { + mrb_value *p; + + p = va_arg(ap, mrb_value*); + if (i < argc) { + *p = *sp++; + i++; + } + } + break; + case 'S': + { + mrb_value *p; + + p = va_arg(ap, mrb_value*); + if (i < argc) { + *p = to_str(mrb, *sp++); + i++; + } + } + break; + case 'A': + { + mrb_value *p; + + p = va_arg(ap, mrb_value*); + if (i < argc) { + *p = to_ary(mrb, *sp++); + i++; + } + } + break; + case 'H': + { + mrb_value *p; + + p = va_arg(ap, mrb_value*); + if (i < argc) { + *p = to_hash(mrb, *sp++); + i++; + } + } + break; + case 's': + { + mrb_value ss; + struct RString *s; + char **ps = 0; + int *pl = 0; + + ps = va_arg(ap, char**); + pl = va_arg(ap, int*); + if (i < argc) { + ss = to_str(mrb, *sp++); + s = mrb_str_ptr(ss); + *ps = s->ptr; + *pl = s->len; + i++; + } + } + break; + case 'z': + { + mrb_value ss; + struct RString *s; + char **ps; + + ps = va_arg(ap, char**); + if (i < argc) { + ss = to_str(mrb, *sp++); + s = mrb_str_ptr(ss); + if (strlen(s->ptr) != s->len) { + mrb_raise(mrb, E_ARGUMENT_ERROR, "String contains NUL"); + } + *ps = s->ptr; + i++; + } + } + break; + case 'a': + { + mrb_value aa; + struct RArray *a; + mrb_value **pb; + int *pl; + + pb = va_arg(ap, mrb_value**); + pl = va_arg(ap, int*); + if (i < argc) { + aa = to_ary(mrb, *sp++); + a = mrb_ary_ptr(aa); + *pb = a->ptr; + *pl = a->len; + i++; + } + } + break; + case 'f': + { + mrb_float *p; + + p = va_arg(ap, mrb_float*); + if (i < argc) { + switch (mrb_type(*sp)) { + case MRB_TT_FLOAT: + *p = mrb_float(*sp); + break; + case MRB_TT_FIXNUM: + *p = (mrb_float)mrb_fixnum(*sp); + break; + case MRB_TT_STRING: + mrb_raise(mrb, E_TYPE_ERROR, "String can't be coerced into Float"); + break; + default: + { + mrb_value tmp; + + tmp = mrb_convert_type(mrb, *sp, MRB_TT_FLOAT, "Float", "to_f"); + *p = mrb_float(tmp); + } + break; + } + sp++; + i++; + } + } + break; + case 'i': + { + mrb_int *p; + + p = va_arg(ap, mrb_int*); + if (i < argc) { + switch (mrb_type(*sp)) { + case MRB_TT_FIXNUM: + *p = mrb_fixnum(*sp); + break; + case MRB_TT_FLOAT: + { + mrb_float f = mrb_float(*sp); + + if (!FIXABLE(f)) { + mrb_raise(mrb, E_RANGE_ERROR, "float too big for int"); + } + *p = (mrb_int)f; + } + break; + case MRB_TT_FALSE: + *p = 0; + break; + default: + { + mrb_value tmp; + + tmp = mrb_convert_type(mrb, *sp, MRB_TT_FIXNUM, "Integer", "to_int"); + *p = mrb_fixnum(tmp); + } + break; + } + sp++; + i++; + } + } + break; + case 'n': + { + mrb_sym *symp; + + symp = va_arg(ap, mrb_sym*); + if (i < argc) { + mrb_value ss; + + ss = *sp++; + if (mrb_type(ss) == MRB_TT_SYMBOL) { + *symp = mrb_symbol(ss); + } + else { + *symp = mrb_intern_str(mrb, to_str(mrb, ss)); + } + i++; + } + } + break; + + case '&': + { + mrb_value *p, *bp; + + p = va_arg(ap, mrb_value*); + if (mrb->ci->argc < 0) { + bp = mrb->stack + 2; + } + else { + bp = mrb->stack + mrb->ci->argc + 1; + } + *p = *bp; + } + break; + case '|': + opt = 1; + break; + + case '*': + { + mrb_value **var; + int *pl; + + var = va_arg(ap, mrb_value**); + pl = va_arg(ap, int*); + if (argc > i) { + *pl = argc-i; + if (*pl > 0) { + *var = sp; + i = argc; + } + i = argc; + sp += *pl; + } + else { + *pl = 0; + *var = NULL; + } + } + break; + default: + mrb_raisef(mrb, E_ARGUMENT_ERROR, "invalid argument specifier %c", c); + break; + } + } + if (!c && argc > i) { + mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments"); + } + va_end(ap); + return i; +} + +static struct RClass* +boot_defclass(mrb_state *mrb, struct RClass *super) +{ + struct RClass *c; + + c = (struct RClass*)mrb_obj_alloc(mrb, MRB_TT_CLASS, mrb->class_class); + c->super = super ? super : mrb->object_class; + mrb_field_write_barrier(mrb, (struct RBasic*)c, (struct RBasic*)super); + c->mt = kh_init(mt, mrb); + return c; +} + +void +mrb_include_module(mrb_state *mrb, struct RClass *c, struct RClass *m) +{ + struct RClass *ins_pos; + + ins_pos = c; + while (m) { + struct RClass *p = c, *ic; + int superclass_seen = 0; + + while(p) { + if (c != p && p->tt == MRB_TT_CLASS) { + superclass_seen = 1; + } + else if (p->mt == m->mt){ + if (p->tt == MRB_TT_ICLASS && !superclass_seen) { + ins_pos = p; + } + goto skip; + } + p = p->super; + } + ic = (struct RClass*)mrb_obj_alloc(mrb, MRB_TT_ICLASS, mrb->class_class); + if (m->tt == MRB_TT_ICLASS) { + ic->c = m->c; + } + else { + ic->c = m; + } + ic->mt = m->mt; + ic->iv = m->iv; + ic->super = ins_pos->super; + ins_pos->super = ic; + mrb_field_write_barrier(mrb, (struct RBasic*)ins_pos, (struct RBasic*)ic); + ins_pos = ic; + skip: + m = m->super; + } +} + +static mrb_value +mrb_mod_append_features(mrb_state *mrb, mrb_value mod) +{ + mrb_value klass; + + mrb_check_type(mrb, mod, MRB_TT_MODULE); + mrb_get_args(mrb, "o", &klass); + mrb_include_module(mrb, mrb_class_ptr(klass), mrb_class_ptr(mod)); + return mod; +} + +static mrb_value +mrb_mod_include(mrb_state *mrb, mrb_value klass) +{ + mrb_value *argv; + int argc, i; + + mrb_get_args(mrb, "*", &argv, &argc); + for (i=0; i<argc; i++) { + mrb_check_type(mrb, argv[i], MRB_TT_MODULE); + } + while (argc--) { + mrb_funcall(mrb, argv[argc], "append_features", 1, klass); + mrb_funcall(mrb, argv[argc], "included", 1, klass); + } + + return klass; +} + +/* 15.2.2.4.28 */ +/* + * call-seq: + * mod.include?(module) -> true or false + * + * Returns <code>true</code> if <i>module</i> is included in + * <i>mod</i> or one of <i>mod</i>'s ancestors. + * + * module A + * end + * class B + * include A + * end + * class C < B + * end + * B.include?(A) #=> true + * C.include?(A) #=> true + * A.include?(A) #=> false + */ +static mrb_value +mrb_mod_include_p(mrb_state *mrb, mrb_value mod) +{ + mrb_value mod2; + struct RClass *c = mrb_class_ptr(mod); + + mrb_get_args(mrb, "o", &mod2); + mrb_check_type(mrb, mod2, MRB_TT_MODULE); + + while (c) { + if (c->tt == MRB_TT_ICLASS) { + if (c->c == mrb_class_ptr(mod2)) return mrb_true_value(); + } + c = c->super; + } + return mrb_false_value(); +} + +static mrb_value +mrb_mod_ancestors(mrb_state *mrb, mrb_value self) +{ + mrb_value result; + struct RClass *c = mrb_class_ptr(self); + + result = mrb_ary_new(mrb); + while (c) { + if (c->tt == MRB_TT_ICLASS) { + mrb_ary_push(mrb, result, mrb_obj_value(c->c)); + } + else { + mrb_ary_push(mrb, result, mrb_obj_value(c)); + } + c = c->super; + } + + return result; +} + +static mrb_value +mrb_mod_extend_object(mrb_state *mrb, mrb_value mod) +{ + mrb_value obj; + + mrb_check_type(mrb, mod, MRB_TT_MODULE); + mrb_get_args(mrb, "o", &obj); + mrb_include_module(mrb, mrb_class_ptr(mrb_singleton_class(mrb, obj)), mrb_class_ptr(mod)); + return mod; +} + +static mrb_value +mrb_mod_included_modules(mrb_state *mrb, mrb_value self) +{ + mrb_value result; + struct RClass *c = mrb_class_ptr(self); + + result = mrb_ary_new(mrb); + while (c) { + if (c->tt == MRB_TT_ICLASS) { + mrb_ary_push(mrb, result, mrb_obj_value(c->c)); + } + c = c->super; + } + + return result; +} + +mrb_value class_instance_method_list(mrb_state*, int, mrb_value*, struct RClass*, int); + +/* 15.2.2.4.33 */ +/* + * call-seq: + * mod.instance_methods(include_super=true) -> array + * + * Returns an array containing the names of the public and protected instance + * methods in the receiver. For a module, these are the public and protected methods; + * for a class, they are the instance (not singleton) methods. With no + * argument, or with an argument that is <code>false</code>, the + * instance methods in <i>mod</i> are returned, otherwise the methods + * in <i>mod</i> and <i>mod</i>'s superclasses are returned. + * + * module A + * def method1() end + * end + * class B + * def method2() end + * end + * class C < B + * def method3() end + * end + * + * A.instance_methods #=> [:method1] + * B.instance_methods(false) #=> [:method2] + * C.instance_methods(false) #=> [:method3] + * C.instance_methods(true).length #=> 43 + */ + +static mrb_value +mrb_mod_instance_methods(mrb_state *mrb, mrb_value mod) +{ + mrb_value *argv; + int argc; + struct RClass *c = mrb_class_ptr(mod); + + mrb_get_args(mrb, "*", &argv, &argc); + return class_instance_method_list(mrb, argc, argv, c, 0); +} + +mrb_value mrb_yield_internal(mrb_state *mrb, mrb_value b, int argc, mrb_value *argv, mrb_value self, struct RClass *c); + +/* 15.2.2.4.35 */ +/* + * call-seq: + * mod.class_eval {| | block } -> obj + * mod.module_eval {| | block } -> obj + * + * Evaluates block in the context of _mod_. This can + * be used to add methods to a class. <code>module_eval</code> returns + * the result of evaluating its argument. + */ + +mrb_value +mrb_mod_module_eval(mrb_state *mrb, mrb_value mod) +{ + mrb_value a, b; + struct RClass *c; + + if (mrb_get_args(mrb, "|S&", &a, &b) == 1) { + mrb_raise(mrb, E_NOTIMP_ERROR, "module_eval/class_eval with string not implemented"); + } + c = mrb_class_ptr(mod); + return mrb_yield_internal(mrb, b, 0, 0, mod, c); +} + +mrb_value +mrb_singleton_class(mrb_state *mrb, mrb_value v) +{ + struct RBasic *obj; + + switch (mrb_type(v)) { + case MRB_TT_FALSE: + if (mrb_nil_p(v)) + return mrb_obj_value(mrb->nil_class); + return mrb_obj_value(mrb->false_class); + case MRB_TT_TRUE: + return mrb_obj_value(mrb->true_class); + case MRB_TT_MAIN: + case MRB_TT_VOIDP: + return mrb_obj_value(mrb->object_class); + case MRB_TT_SYMBOL: + case MRB_TT_FIXNUM: + case MRB_TT_FLOAT: + mrb_raise(mrb, E_TYPE_ERROR, "can't define singleton"); + return mrb_nil_value(); /* not reached */ + default: + break; + } + obj = mrb_object(v); + prepare_singleton_class(mrb, obj); + return mrb_obj_value(obj->c); +} + +void +mrb_define_singleton_method(mrb_state *mrb, struct RObject *o, const char *name, mrb_func_t func, int aspec) +{ + prepare_singleton_class(mrb, (struct RBasic*)o); + mrb_define_method_id(mrb, o->c, mrb_intern(mrb, name), func, aspec); +} + +void +mrb_define_class_method(mrb_state *mrb, struct RClass *c, const char *name, mrb_func_t func, int aspec) +{ + mrb_define_singleton_method(mrb, (struct RObject*)c, name, func, aspec); +} + +void +mrb_define_module_function(mrb_state *mrb, struct RClass *c, const char *name, mrb_func_t func, int aspec) +{ + mrb_define_class_method(mrb, c, name, func, aspec); + mrb_define_method(mrb, c, name, func, aspec); +} + +struct RProc* +mrb_method_search_vm(mrb_state *mrb, struct RClass **cp, mrb_sym mid) +{ + khiter_t k; + struct RProc *m; + struct RClass *c = *cp; + + while (c) { + khash_t(mt) *h = c->mt; + + if (h) { + k = kh_get(mt, h, mid); + if (k != kh_end(h)) { + m = kh_value(h, k); + if (!m) break; + *cp = c; + return m; + } + } + c = c->super; + } + return 0; /* no method */ +} + +struct RProc* +mrb_method_search(mrb_state *mrb, struct RClass* c, mrb_sym mid) +{ + struct RProc *m; + + m = mrb_method_search_vm(mrb, &c, mid); + if (!m) { + mrb_value inspect = mrb_funcall(mrb, mrb_obj_value(c), "inspect", 0); + if (RSTRING_LEN(inspect) > 64) { + inspect = mrb_any_to_s(mrb, mrb_obj_value(c)); + } + mrb_raisef(mrb, E_NAME_ERROR, "undefined method '%s' for class %s", + mrb_sym2name(mrb, mid), RSTRING_PTR(inspect)); + } + return m; +} + +void +mrb_obj_call_init(mrb_state *mrb, mrb_value obj, int argc, mrb_value *argv) +{ + mrb_funcall_argv(mrb, obj, mrb->init_sym, argc, argv); +} + +/* + * call-seq: + * class.new(args, ...) -> obj + * + * Calls <code>allocate</code> to create a new object of + * <i>class</i>'s class, then invokes that object's + * <code>initialize</code> method, passing it <i>args</i>. + * This is the method that ends up getting called whenever + * an object is constructed using .new. + * + */ +mrb_value +mrb_class_new_instance(mrb_state *mrb, int argc, mrb_value *argv, struct RClass * klass) +{ + mrb_value obj; + struct RClass * c = (struct RClass*)mrb_obj_alloc(mrb, klass->tt, klass); + c->super = klass; + obj = mrb_obj_value(c); + mrb_obj_call_init(mrb, obj, argc, argv); + return obj; +} + +mrb_value +mrb_class_new_instance_m(mrb_state *mrb, mrb_value klass) +{ + mrb_value *argv; + mrb_value blk; + struct RClass *k = mrb_class_ptr(klass); + struct RClass *c; + int argc; + mrb_value obj; + + mrb_get_args(mrb, "*&", &argv, &argc, &blk); + c = (struct RClass*)mrb_obj_alloc(mrb, k->tt, k); + c->super = k; + obj = mrb_obj_value(c); + mrb_funcall_with_block(mrb, obj, mrb->init_sym, argc, argv, blk); + + return obj; +} + +mrb_value +mrb_instance_new(mrb_state *mrb, mrb_value cv) +{ + struct RClass *c = mrb_class_ptr(cv); + struct RObject *o; + enum mrb_vtype ttype = MRB_INSTANCE_TT(c); + mrb_value obj, blk; + mrb_value *argv; + int argc; + + if (ttype == 0) ttype = MRB_TT_OBJECT; + o = (struct RObject*)mrb_obj_alloc(mrb, ttype, c); + obj = mrb_obj_value(o); + mrb_get_args(mrb, "*&", &argv, &argc, &blk); + mrb_funcall_with_block(mrb, obj, mrb->init_sym, argc, argv, blk); + + return obj; +} + +mrb_value +mrb_class_new_class(mrb_state *mrb, mrb_value cv) +{ + mrb_value super; + struct RClass *new_class; + + if (mrb_get_args(mrb, "|o", &super) == 0) { + super = mrb_obj_value(mrb->object_class); + } + new_class = mrb_class_new(mrb, mrb_class_ptr(super)); + return mrb_obj_value(new_class); +} + +mrb_value +mrb_class_superclass(mrb_state *mrb, mrb_value klass) +{ + struct RClass *c; + + c = mrb_class_ptr(klass); + c = c->super; + while (c && c->tt == MRB_TT_ICLASS) { + c = c->super; + } + if (!c) return mrb_nil_value(); + return mrb_obj_value(c); +} + +static mrb_value +mrb_bob_init(mrb_state *mrb, mrb_value cv) +{ + return mrb_nil_value(); +} + +static mrb_value +mrb_bob_not(mrb_state *mrb, mrb_value cv) +{ + if (mrb_test(cv)) + return mrb_false_value(); + return mrb_true_value(); +} + +/* 15.3.1.3.30 */ +/* + * call-seq: + * obj.method_missing(symbol [, *args] ) -> result + * + * Invoked by Ruby when <i>obj</i> is sent a message it cannot handle. + * <i>symbol</i> is the symbol for the method called, and <i>args</i> + * are any arguments that were passed to it. By default, the interpreter + * raises an error when this method is called. However, it is possible + * to override the method to provide more dynamic behavior. + * If it is decided that a particular method should not be handled, then + * <i>super</i> should be called, so that ancestors can pick up the + * missing method. + * The example below creates + * a class <code>Roman</code>, which responds to methods with names + * consisting of roman numerals, returning the corresponding integer + * values. + * + * class Roman + * def romanToInt(str) + * # ... + * end + * def method_missing(methId) + * str = methId.id2name + * romanToInt(str) + * end + * end + * + * r = Roman.new + * r.iv #=> 4 + * r.xxiii #=> 23 + * r.mm #=> 2000 + */ +static mrb_value +mrb_bob_missing(mrb_state *mrb, mrb_value mod) +{ + mrb_value name, *a; + int alen; + mrb_value inspect; + + mrb_get_args(mrb, "o*", &name, &a, &alen); + if (!mrb_symbol_p(name)) { + mrb_raise(mrb, E_TYPE_ERROR, "name should be a symbol"); + } + + inspect = mrb_funcall(mrb, mod, "inspect", 0); + if (RSTRING_LEN(inspect) > 64) { + inspect = mrb_any_to_s(mrb, mod); + } + + mrb_raisef(mrb, E_NOMETHOD_ERROR, "undefined method '%s' for %s", + mrb_sym2name(mrb, mrb_symbol(name)), RSTRING_PTR(inspect)); + /* not reached */ + return mrb_nil_value(); +} + +int +mrb_obj_respond_to(struct RClass* c, mrb_sym mid) +{ + khiter_t k; + + while (c) { + khash_t(mt) *h = c->mt; + + if (h) { + k = kh_get(mt, h, mid); + if (k != kh_end(h)) { + if (kh_value(h, k)) { + return TRUE; /* method exists */ + } + else { + return FALSE; /* undefined method */ + } + } + } + c = c->super; + } + return FALSE; /* no method */ +} + +int +mrb_respond_to(mrb_state *mrb, mrb_value obj, mrb_sym mid) +{ + return mrb_obj_respond_to(mrb_class(mrb, obj), mid); +} + +mrb_value +mrb_class_path(mrb_state *mrb, struct RClass *c) +{ + mrb_value path; + const char *name; + int len; + + path = mrb_obj_iv_get(mrb, (struct RObject*)c, mrb_intern(mrb, "__classpath__")); + if (mrb_nil_p(path)) { + struct RClass *outer = mrb_class_outer_module(mrb, c); + mrb_sym sym = mrb_class_sym(mrb, c, outer); + if (sym == 0) { + return mrb_nil_value(); + } + else if (outer && outer != mrb->object_class) { + mrb_value base = mrb_class_path(mrb, outer); + path = mrb_str_plus(mrb, base, mrb_str_new(mrb, "::", 2)); + name = mrb_sym2name_len(mrb, sym, &len); + mrb_str_concat(mrb, path, mrb_str_new(mrb, name, len)); + } + else { + name = mrb_sym2name_len(mrb, sym, &len); + path = mrb_str_new(mrb, name, len); + } + mrb_obj_iv_set(mrb, (struct RObject*)c, mrb_intern(mrb, "__classpath__"), path); + } + return path; +} + +struct RClass * +mrb_class_real(struct RClass* cl) +{ + while ((cl->tt == MRB_TT_SCLASS) || (cl->tt == MRB_TT_ICLASS)) { + cl = cl->super; + } + return cl; +} + +const char* +mrb_class_name(mrb_state *mrb, struct RClass* c) +{ + mrb_value path = mrb_class_path(mrb, c); + if (mrb_nil_p(path)) return 0; + return mrb_str_ptr(path)->ptr; +} + +const char* +mrb_obj_classname(mrb_state *mrb, mrb_value obj) +{ + return mrb_class_name(mrb, mrb_obj_class(mrb, obj)); +} + +/*! + * Ensures a class can be derived from super. + * + * \param super a reference to an object. + * \exception TypeError if \a super is not a Class or \a super is a singleton class. + */ +void +mrb_check_inheritable(mrb_state *mrb, struct RClass *super) +{ + if (super->tt != MRB_TT_CLASS) { + mrb_raisef(mrb, E_TYPE_ERROR, "superclass must be a Class (%s given)", + mrb_obj_classname(mrb, mrb_obj_value(super))); + } + if (super->tt == MRB_TT_SCLASS) { + mrb_raise(mrb, E_TYPE_ERROR, "can't make subclass of singleton class"); + } + if (super == mrb->class_class) { + mrb_raise(mrb, E_TYPE_ERROR, "can't make subclass of Class"); + } +} + +/*! + * Creates a new class. + * \param super a class from which the new class derives. + * \exception TypeError \a super is not inheritable. + * \exception TypeError \a super is the Class class. + */ +struct RClass * +mrb_class_new(mrb_state *mrb, struct RClass *super) +{ + struct RClass *c; + + if (super) { + mrb_check_inheritable(mrb, super); + } + c = boot_defclass(mrb, super); + if (super){ + MRB_SET_INSTANCE_TT(c, MRB_INSTANCE_TT(super)); + } + make_metaclass(mrb, c); + + return c; +} + +/*! + * Creates a new module. + */ +struct RClass * +mrb_module_new(mrb_state *mrb) +{ + struct RClass *m = (struct RClass*)mrb_obj_alloc(mrb, MRB_TT_MODULE, mrb->module_class); + m->mt = kh_init(mt, mrb); + + return m; +} + +/* + * call-seq: + * obj.class => class + * + * Returns the class of <i>obj</i>, now preferred over + * <code>Object#type</code>, as an object's type in Ruby is only + * loosely tied to that object's class. This method must always be + * called with an explicit receiver, as <code>class</code> is also a + * reserved word in Ruby. + * + * 1.class #=> Fixnum + * self.class #=> Object + */ + +struct RClass* +mrb_obj_class(mrb_state *mrb, mrb_value obj) +{ + return mrb_class_real(mrb_class(mrb, obj)); +} + +void +mrb_alias_method(mrb_state *mrb, struct RClass *c, mrb_sym a, mrb_sym b) +{ + struct RProc *m = mrb_method_search(mrb, c, b); + + mrb_define_method_vm(mrb, c, a, mrb_obj_value(m)); +} + +/*! + * Defines an alias of a method. + * \param klass the class which the original method belongs to + * \param name1 a new name for the method + * \param name2 the original name of the method + */ +void +mrb_define_alias(mrb_state *mrb, struct RClass *klass, const char *name1, const char *name2) +{ + mrb_alias_method(mrb, klass, mrb_intern(mrb, name1), mrb_intern(mrb, name2)); +} + +/* + * call-seq: + * mod.to_s -> string + * + * Return a string representing this module or class. For basic + * classes and modules, this is the name. For singletons, we + * show information on the thing we're attached to as well. + */ + +static mrb_value +mrb_mod_to_s(mrb_state *mrb, mrb_value klass) +{ + if (mrb_type(klass) == MRB_TT_SCLASS) { + mrb_value s = mrb_str_new(mrb, "#<", 2); + mrb_value v = mrb_iv_get(mrb, klass, mrb_intern(mrb, "__attached__")); + + mrb_str_cat2(mrb, s, "Class:"); + switch (mrb_type(v)) { + case MRB_TT_CLASS: + case MRB_TT_MODULE: + case MRB_TT_SCLASS: + mrb_str_append(mrb, s, mrb_inspect(mrb, v)); + break; + default: + mrb_str_append(mrb, s, mrb_any_to_s(mrb, v)); + break; + } + mrb_str_cat2(mrb, s, ">"); + + return s; + } + else { + struct RClass *c = mrb_class_ptr(klass); + const char *cn = mrb_class_name(mrb, c); + + if (!cn) { + char buf[256]; + int n = 0; + + switch (mrb_type(klass)) { + case MRB_TT_CLASS: + n = snprintf(buf, sizeof(buf), "#<Class:%p>", c); + break; + + case MRB_TT_MODULE: + n = snprintf(buf, sizeof(buf), "#<Module:%p>", c); + break; + + default: + break; + } + return mrb_str_dup(mrb, mrb_str_new(mrb, buf, n)); + } + else { + return mrb_str_dup(mrb, mrb_str_new_cstr(mrb, cn)); + } + } +} + +mrb_value +mrb_mod_alias(mrb_state *mrb, mrb_value mod) +{ + struct RClass *c = mrb_class_ptr(mod); + mrb_value new_value, old_value; + + mrb_get_args(mrb, "oo", &new_value, &old_value); + mrb_alias_method(mrb, c, mrb_symbol(new_value), mrb_symbol(old_value)); + return mrb_nil_value(); +} + + +static void +undef_method(mrb_state *mrb, struct RClass *c, mrb_sym a) +{ + mrb_value m; + + MRB_SET_VALUE(m, MRB_TT_PROC, value.p, 0); + mrb_define_method_vm(mrb, c, a, m); +} + +void +mrb_undef_method(mrb_state *mrb, struct RClass *c, const char *name) +{ + undef_method(mrb, c, mrb_intern(mrb, name)); +} + +void +mrb_undef_class_method(mrb_state *mrb, struct RClass *c, const char *name) +{ + mrb_undef_method(mrb, mrb_class_ptr(mrb_singleton_class(mrb, mrb_obj_value(c))), name); +} + +mrb_value +mrb_mod_undef(mrb_state *mrb, mrb_value mod) +{ + struct RClass *c = mrb_class_ptr(mod); + int argc; + mrb_value *argv; + + mrb_get_args(mrb, "*", &argv, &argc); + while (argc--) { + undef_method(mrb, c, mrb_symbol(*argv)); + argv++; + } + return mrb_nil_value(); +} + +static mrb_value +mod_define_method(mrb_state *mrb, mrb_value self) +{ + struct RClass *c = mrb_class_ptr(self); + struct RProc *p; + mrb_sym mid; + mrb_value blk; + + mrb_get_args(mrb, "n&", &mid, &blk); + if (mrb_nil_p(blk)) { + mrb_raise(mrb, E_ARGUMENT_ERROR, "no block given"); + } + p = (struct RProc*)mrb_obj_alloc(mrb, MRB_TT_PROC, mrb->proc_class); + mrb_proc_copy(p, mrb_proc_ptr(blk)); + mrb_define_method_raw(mrb, c, mid, p); + return blk; +} + +static mrb_sym +mrb_sym_value(mrb_state *mrb, mrb_value val) +{ + if (mrb_string_p(val)) { + return mrb_intern_str(mrb, val); + } + else if(!mrb_symbol_p(val)) { + mrb_value obj = mrb_funcall(mrb, val, "inspect", 0); + mrb_raisef(mrb, E_TYPE_ERROR, "%s is not a symbol", + mrb_string_value_ptr(mrb, obj)); + } + return mrb_symbol(val); +} + +static void +check_cv_name(mrb_state *mrb, mrb_sym id) +{ + const char *s; + int len; + + s = mrb_sym2name_len(mrb, id, &len); + if (len < 3 || !(s[0] == '@' && s[1] == '@')) { + mrb_name_error(mrb, id, "`%s' is not allowed as a class variable name", s); + } +} + +/* 15.2.2.4.16 */ +/* + * call-seq: + * obj.class_variable_defined?(symbol) -> true or false + * + * Returns <code>true</code> if the given class variable is defined + * in <i>obj</i>. + * + * class Fred + * @@foo = 99 + * end + * Fred.class_variable_defined?(:@@foo) #=> true + * Fred.class_variable_defined?(:@@bar) #=> false + */ + +static mrb_value +mrb_mod_cvar_defined(mrb_state *mrb, mrb_value mod) +{ + mrb_value sym; + mrb_sym id; + mrb_get_args(mrb, "o", &sym); + + id = mrb_sym_value(mrb,sym); + check_cv_name(mrb, id); + + if(mrb_cv_defined(mrb, mod, id)) + return mrb_true_value(); + return mrb_false_value(); +} + +/* 15.2.2.4.17 */ +/* + * call-seq: + * mod.class_variable_get(symbol) -> obj + * + * Returns the value of the given class variable (or throws a + * <code>NameError</code> exception). The <code>@@</code> part of the + * variable name should be included for regular class variables + * + * class Fred + * @@foo = 99 + * end + * Fred.class_variable_get(:@@foo) #=> 99 + */ + +static mrb_value +mrb_mod_cvar_get(mrb_state *mrb, mrb_value mod) +{ + mrb_value sym; + mrb_sym id; + mrb_get_args(mrb, "o", &sym); + + id = mrb_sym_value(mrb,sym); + check_cv_name(mrb, id); + return mrb_cv_get(mrb, mod, id); +} + +/* 15.2.2.4.18 */ +/* + * call-seq: + * obj.class_variable_set(symbol, obj) -> obj + * + * Sets the class variable names by <i>symbol</i> to + * <i>object</i>. + * + * class Fred + * @@foo = 99 + * def foo + * @@foo + * end + * end + * Fred.class_variable_set(:@@foo, 101) #=> 101 + * Fred.new.foo #=> 101 + */ + +static mrb_value +mrb_mod_cvar_set(mrb_state *mrb, mrb_value mod) +{ + mrb_value sym, value; + mrb_sym id; + mrb_get_args(mrb, "oo", &sym, &value); + + id = mrb_sym_value(mrb,sym); + + check_cv_name(mrb, id); + mrb_cv_set(mrb, mod, id, value); + return value; +} + +/* 15.2.2.4.39 */ +/* + * call-seq: + * remove_class_variable(sym) -> obj + * + * Removes the definition of the <i>sym</i>, returning that + * constant's value. + * + * class Dummy + * @@var = 99 + * puts @@var + * p class_variables + * remove_class_variable(:@@var) + * p class_variables + * end + * + * <em>produces:</em> + * + * 99 + * [:@@var] + * [] + */ + +mrb_value +mrb_mod_remove_cvar(mrb_state *mrb, mrb_value mod) +{ + mrb_value sym, val; + mrb_sym id; + + mrb_get_args(mrb, "o", &sym); + + id = mrb_sym_value(mrb,sym); + check_cv_name(mrb, id); + + val = mrb_iv_remove(mrb, mod, id); + + if (!mrb_undef_p(val)) return val; + + if (mrb_cv_defined(mrb, mod, id)){ + mrb_name_error(mrb, id, "cannot remove %s for %s", + mrb_sym2name(mrb, id), mrb_class_name(mrb, mrb_class_ptr(mod))); + } + + mrb_name_error(mrb, id, "class variable %s not defined for %s", + mrb_sym2name(mrb, id), mrb_class_name(mrb, mrb_class_ptr(mod))); + + /* not reached */ + return mrb_nil_value(); +} + +/* 15.2.2.4.34 */ +/* + * call-seq: + * mod.method_defined?(symbol) -> true or false + * + * Returns +true+ if the named method is defined by + * _mod_ (or its included modules and, if _mod_ is a class, + * its ancestors). Public and protected methods are matched. + * + * module A + * def method1() end + * end + * class B + * def method2() end + * end + * class C < B + * include A + * def method3() end + * end + * + * A.method_defined? :method1 #=> true + * C.method_defined? "method1" #=> true + * C.method_defined? "method2" #=> true + * C.method_defined? "method3" #=> true + * C.method_defined? "method4" #=> false + */ + +static mrb_value +mrb_mod_method_defined(mrb_state *mrb, mrb_value mod) +{ + mrb_value sym; + mrb_sym id; + + mrb_get_args(mrb, "o", &sym); + id = mrb_sym_value(mrb,sym); + + if (mrb_obj_respond_to(mrb_class_ptr(mod), id)) { + return mrb_true_value(); + } + return mrb_false_value(); +} + +static void +remove_method(mrb_state *mrb, struct RClass *c, mrb_sym mid) +{ + khash_t(mt) *h = c->mt; + khiter_t k; + + if (h) { + k = kh_get(mt, h, mid); + if (k != kh_end(h)) { + kh_del(mt, h, k); + return; + } + } + + mrb_name_error(mrb, mid, "method `%s' not defined in %s", + mrb_sym2name(mrb, mid), mrb_class_name(mrb, c)); +} + +/* 15.2.2.4.41 */ +/* + * call-seq: + * remove_method(symbol) -> self + * + * Removes the method identified by _symbol_ from the current + * class. For an example, see <code>Module.undef_method</code>. + */ + +mrb_value +mrb_mod_remove_method(mrb_state *mrb, mrb_value mod) +{ + struct RClass *c = mrb_class_ptr(mod); + int argc; + mrb_value *argv; + + mrb_get_args(mrb, "*", &argv, &argc); + while (argc--) { + remove_method(mrb, c, mrb_symbol(*argv)); + argv++; + } + return mod; +} + +static void +check_const_name(mrb_state *mrb, mrb_sym id) +{ + const char *s; + int len; + + s = mrb_sym2name_len(mrb, id, &len); + if (len < 1 || !ISUPPER(*s)) { + mrb_name_error(mrb, id, "wrong constant name %s", s); + } +} + +mrb_value +mrb_mod_const_defined(mrb_state *mrb, mrb_value mod) +{ + mrb_value sym; + mrb_get_args(mrb, "o", &sym); + + check_const_name(mrb, mrb_sym_value(mrb,sym)); + if(mrb_const_defined(mrb, mod, mrb_sym_value(mrb, sym))) { + return mrb_true_value(); + } + return mrb_false_value(); +} + +mrb_value +mrb_mod_const_get(mrb_state *mrb, mrb_value mod) +{ + mrb_value sym; + mrb_get_args(mrb, "o", &sym); + + check_const_name(mrb, mrb_sym_value(mrb,sym)); + return mrb_const_get(mrb, mod, mrb_sym_value(mrb, sym)); +} + +mrb_value +mrb_mod_const_set(mrb_state *mrb, mrb_value mod) +{ + mrb_value sym, value; + mrb_get_args(mrb, "oo", &sym, &value); + + check_const_name(mrb, mrb_sym_value(mrb,sym)); + mrb_const_set(mrb, mod, mrb_sym_value(mrb, sym), value); + return value; +} + + +static mrb_value +mrb_mod_eqq(mrb_state *mrb, mrb_value mod) +{ + mrb_value obj; + + mrb_get_args(mrb, "o", &obj); + if (!mrb_obj_is_kind_of(mrb, obj, mrb_class_ptr(mod))) + return mrb_false_value(); + return mrb_true_value(); +} + +void +mrb_init_class(mrb_state *mrb) +{ + struct RClass *bob; /* BasicObject */ + struct RClass *obj; /* Object */ + struct RClass *mod; /* Module */ + struct RClass *cls; /* Class */ + //struct RClass *krn; /* Kernel */ + + /* boot class hierarchy */ + bob = boot_defclass(mrb, 0); + obj = boot_defclass(mrb, bob); mrb->object_class = obj; + mod = boot_defclass(mrb, obj); mrb->module_class = mod;/* obj -> mod */ + cls = boot_defclass(mrb, mod); mrb->class_class = cls; /* obj -> cls */ + /* fix-up loose ends */ + bob->c = obj->c = mod->c = cls->c = cls; + make_metaclass(mrb, bob); + make_metaclass(mrb, obj); + make_metaclass(mrb, mod); + make_metaclass(mrb, cls); + + /* name basic classes */ + mrb_define_const(mrb, bob, "BasicObject", mrb_obj_value(bob)); + mrb_define_const(mrb, obj, "BasicObject", mrb_obj_value(bob)); + mrb_define_const(mrb, obj, "Object", mrb_obj_value(obj)); + mrb_define_const(mrb, obj, "Module", mrb_obj_value(mod)); + mrb_define_const(mrb, obj, "Class", mrb_obj_value(cls)); + + /* name each classes */ + mrb_name_class(mrb, bob, mrb_intern(mrb, "BasicObject")); + mrb_name_class(mrb, obj, mrb_intern(mrb, "Object")); + mrb_name_class(mrb, mod, mrb_intern(mrb, "Module")); + mrb_name_class(mrb, cls, mrb_intern(mrb, "Class")); + + mrb_undef_method(mrb, mod, "new"); + MRB_SET_INSTANCE_TT(cls, MRB_TT_CLASS); + mrb_define_method(mrb, bob, "initialize", mrb_bob_init, ARGS_NONE()); + mrb_define_method(mrb, bob, "!", mrb_bob_not, ARGS_NONE()); + mrb_define_method(mrb, bob, "method_missing", mrb_bob_missing, ARGS_ANY()); /* 15.3.1.3.30 */ + mrb_define_class_method(mrb, cls, "new", mrb_class_new_class, ARGS_ANY()); + mrb_define_method(mrb, cls, "superclass", mrb_class_superclass, ARGS_NONE()); /* 15.2.3.3.4 */ + mrb_define_method(mrb, cls, "new", mrb_instance_new, ARGS_ANY()); /* 15.2.3.3.3 */ + mrb_define_method(mrb, cls, "inherited", mrb_bob_init, ARGS_REQ(1)); + mrb_define_method(mrb, mod, "class_variable_defined?", mrb_mod_cvar_defined, ARGS_REQ(1)); /* 15.2.2.4.16 */ + mrb_define_method(mrb, mod, "class_variable_get", mrb_mod_cvar_get, ARGS_REQ(1)); /* 15.2.2.4.17 */ + mrb_define_method(mrb, mod, "class_variable_set", mrb_mod_cvar_set, ARGS_REQ(2)); /* 15.2.2.4.18 */ + mrb_define_method(mrb, mod, "extend_object", mrb_mod_extend_object, ARGS_REQ(1)); /* 15.2.2.4.25 */ + mrb_define_method(mrb, mod, "extended", mrb_bob_init, ARGS_REQ(1)); /* 15.2.2.4.26 */ + mrb_define_method(mrb, mod, "include", mrb_mod_include, ARGS_ANY()); /* 15.2.2.4.27 */ + mrb_define_method(mrb, mod, "include?", mrb_mod_include_p, ARGS_REQ(1)); /* 15.2.2.4.28 */ + mrb_define_method(mrb, mod, "append_features", mrb_mod_append_features, ARGS_REQ(1)); /* 15.2.2.4.10 */ + mrb_define_method(mrb, mod, "class_eval", mrb_mod_module_eval, ARGS_ANY()); /* 15.2.2.4.15 */ + mrb_define_method(mrb, mod, "included", mrb_bob_init, ARGS_REQ(1)); /* 15.2.2.4.29 */ + mrb_define_method(mrb, mod, "included_modules", mrb_mod_included_modules, ARGS_NONE()); /* 15.2.2.4.30 */ + mrb_define_method(mrb, mod, "instance_methods", mrb_mod_instance_methods, ARGS_ANY()); /* 15.2.2.4.33 */ + mrb_define_method(mrb, mod, "method_defined?", mrb_mod_method_defined, ARGS_REQ(1)); /* 15.2.2.4.34 */ + mrb_define_method(mrb, mod, "module_eval", mrb_mod_module_eval, ARGS_ANY()); /* 15.2.2.4.35 */ + mrb_define_method(mrb, mod, "remove_class_variable", mrb_mod_remove_cvar, ARGS_REQ(1)); /* 15.2.2.4.39 */ + mrb_define_method(mrb, mod, "remove_method", mrb_mod_remove_method, ARGS_ANY()); /* 15.2.2.4.41 */ + + mrb_define_method(mrb, mod, "to_s", mrb_mod_to_s, ARGS_NONE()); + mrb_define_method(mrb, mod, "inspect", mrb_mod_to_s, ARGS_NONE()); + mrb_define_method(mrb, mod, "alias_method", mrb_mod_alias, ARGS_ANY()); /* 15.2.2.4.8 */ + mrb_define_method(mrb, mod, "ancestors", mrb_mod_ancestors, ARGS_NONE()); /* 15.2.2.4.9 */ + mrb_define_method(mrb, mod, "undef_method", mrb_mod_undef, ARGS_ANY()); /* 15.2.2.4.41 */ + mrb_define_method(mrb, mod, "const_defined?", mrb_mod_const_defined, ARGS_REQ(1)); /* 15.2.2.4.20 */ + mrb_define_method(mrb, mod, "const_get", mrb_mod_const_get, ARGS_REQ(1)); /* 15.2.2.4.21 */ + mrb_define_method(mrb, mod, "const_set", mrb_mod_const_set, ARGS_REQ(2)); /* 15.2.2.4.23 */ + mrb_define_method(mrb, mod, "define_method", mod_define_method, ARGS_REQ(1)); + mrb_define_method(mrb, mod, "class_variables", mrb_mod_class_variables, ARGS_NONE()); /* 15.2.2.4.19 */ + + mrb_define_method(mrb, mod, "===", mrb_mod_eqq, ARGS_REQ(1)); + mrb_undef_method(mrb, cls, "append_features"); + mrb_undef_method(mrb, cls, "extend_object"); +} Added: vendor/mruby-b5830ae/src/codegen.c (+2590 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/codegen.c 2013-01-09 13:19:18 +0900 (c1a6232) @@ -0,0 +1,2590 @@ +/* +** codegen.c - mruby code generator +** +** See Copyright Notice in mruby.h +*/ + +#undef CODEGEN_TEST +#define CODEGEN_DUMP + +#include "mruby.h" +#include "mruby/string.h" +#include "mruby/irep.h" +#include "mruby/compile.h" +#include "mruby/numeric.h" +#include "opcode.h" +#include "node.h" +#include <string.h> +#include <stdlib.h> +#include <ctype.h> + +typedef mrb_ast_node node; +typedef struct mrb_parser_state parser_state; + +enum looptype { + LOOP_NORMAL, + LOOP_BLOCK, + LOOP_FOR, + LOOP_BEGIN, + LOOP_RESCUE, +} type; + +struct loopinfo { + enum looptype type; + int pc1, pc2, pc3, acc; + int ensure_level; + struct loopinfo *prev; +}; + +typedef struct scope { + mrb_state *mrb; + mrb_pool *mpool; + jmp_buf jmp; + + struct scope *prev; + + node *lv; + + int sp; + int pc; + int lastlabel; + int ainfo:15; + int mscope:1; + + struct loopinfo *loop; + int ensure_level; + char *filename; + short lineno; + + mrb_code *iseq; + short *lines; + int icapa; + + mrb_irep *irep; + int pcapa; + int scapa; + + int nlocals; + int nregs; + int ai; + + int idx; +} codegen_scope; + +static codegen_scope* scope_new(mrb_state *mrb, codegen_scope *prev, node *lv); +static void scope_finish(codegen_scope *s); +static struct loopinfo *loop_push(codegen_scope *s, enum looptype t); +static void loop_break(codegen_scope *s, node *tree); +static void loop_pop(codegen_scope *s, int val); + +static void gen_assignment(codegen_scope *s, node *node, int sp, int val); +static void gen_vmassignment(codegen_scope *s, node *tree, int rhs, int val); + +static void codegen(codegen_scope *s, node *tree, int val); + +static void +codegen_error(codegen_scope *s, const char *message) +{ + if (!s) return; + while (s->prev) { + mrb_pool_close(s->mpool); + s = s->prev; + } + mrb_pool_close(s->mpool); +#ifdef ENABLE_STDIO + if (s->filename && s->lineno) { + fprintf(stderr, "codegen error:%s:%d: %s\n", s->filename, s->lineno, message); + } + else { + fprintf(stderr, "codegen error: %s\n", message); + } +#endif + longjmp(s->jmp, 1); +} + +static void* +codegen_palloc(codegen_scope *s, size_t len) +{ + void *p = mrb_pool_alloc(s->mpool, len); + + if (!p) codegen_error(s, "pool memory allocation"); + return p; +} + +void* +codegen_malloc(codegen_scope *s, size_t len) +{ + void *p = mrb_malloc(s->mrb, len); + + if (!p) codegen_error(s, "mrb_malloc"); + return p; +} + +void* +codegen_realloc(codegen_scope *s, void *p, size_t len) +{ + p = mrb_realloc(s->mrb, p, len); + + if (!p && len > 0) codegen_error(s, "mrb_realloc"); + return p; +} + +static int +new_label(codegen_scope *s) +{ + s->lastlabel = s->pc; + return s->pc; +} + +static inline void +genop(codegen_scope *s, mrb_code i) +{ + if (s->pc == s->icapa) { + s->icapa *= 2; + s->iseq = (mrb_code *)codegen_realloc(s, s->iseq, sizeof(mrb_code)*s->icapa); + if (s->lines) { + s->lines = (short*)codegen_realloc(s, s->lines, sizeof(short)*s->icapa); + } + } + s->iseq[s->pc] = i; + if (s->lines) { + s->lines[s->pc] = s->lineno; + } + s->pc++; +} + +#define NOVAL 0 +#define VAL 1 + +static void +genop_peep(codegen_scope *s, mrb_code i, int val) +{ + /* peephole optimization */ + if (s->lastlabel != s->pc && s->pc > 0) { + mrb_code i0 = s->iseq[s->pc-1]; + int c1 = GET_OPCODE(i); + int c0 = GET_OPCODE(i0); + + switch (c1) { + case OP_MOVE: + if (GETARG_A(i) == GETARG_B(i)) { + /* skip useless OP_MOVE */ + return; + } + if (val) break; + switch (c0) { + case OP_MOVE: + if (GETARG_B(i) == GETARG_A(i0) && GETARG_A(i) == GETARG_B(i0) && GETARG_A(i) >= s->nlocals) { + /* skip swapping OP_MOVE */ + return; + } + if (GETARG_B(i) == GETARG_A(i0) && GETARG_A(i0) >= s->nlocals) { + s->iseq[s->pc-1] = MKOP_AB(OP_MOVE, GETARG_A(i), GETARG_B(i0)); + return; + } + break; + case OP_LOADI: + if (GETARG_B(i) == GETARG_A(i0) && GETARG_A(i0) >= s->nlocals) { + s->iseq[s->pc-1] = MKOP_AsBx(OP_LOADI, GETARG_A(i), GETARG_sBx(i0)); + return; + } + break; + case OP_ARRAY: + case OP_HASH: + case OP_RANGE: + case OP_AREF: + case OP_GETUPVAR: + if (GETARG_B(i) == GETARG_A(i0) && GETARG_A(i0) >= s->nlocals) { + s->iseq[s->pc-1] = MKOP_ABC(c0, GETARG_A(i), GETARG_B(i0), GETARG_C(i0)); + return; + } + break; + case OP_LOADSYM: + case OP_GETGLOBAL: + case OP_GETIV: + case OP_GETCV: + case OP_GETCONST: + case OP_GETSPECIAL: + case OP_LOADL: + case OP_STRING: + if (GETARG_B(i) == GETARG_A(i0) && GETARG_A(i0) >= s->nlocals) { + s->iseq[s->pc-1] = MKOP_ABx(c0, GETARG_A(i), GETARG_Bx(i0)); + return; + } + break; + case OP_SCLASS: + if (GETARG_B(i) == GETARG_A(i0) && GETARG_A(i0) >= s->nlocals) { + s->iseq[s->pc-1] = MKOP_AB(c0, GETARG_A(i), GETARG_B(i0)); + return; + } + break; + case OP_LOADNIL: + case OP_LOADSELF: + case OP_LOADT: + case OP_LOADF: + case OP_OCLASS: + if (GETARG_B(i) == GETARG_A(i0) && GETARG_A(i0) >= s->nlocals) { + s->iseq[s->pc-1] = MKOP_A(c0, GETARG_A(i)); + return; + } + break; + default: + break; + } + break; + case OP_SETIV: + case OP_SETCV: + case OP_SETCONST: + case OP_SETMCNST: + case OP_SETGLOBAL: + if (val) break; + if (c0 == OP_MOVE) { + if (GETARG_A(i) == GETARG_A(i0)) { + s->iseq[s->pc-1] = MKOP_ABx(c1, GETARG_B(i0), GETARG_Bx(i)); + return; + } + } + break; + case OP_SETUPVAR: + if (val) break; + if (c0 == OP_MOVE) { + if (GETARG_A(i) == GETARG_A(i0)) { + s->iseq[s->pc-1] = MKOP_ABC(c1, GETARG_B(i0), GETARG_B(i), GETARG_C(i)); + return; + } + } + break; + case OP_EPOP: + if (c0 == OP_EPOP) { + s->iseq[s->pc-1] = MKOP_A(OP_EPOP, GETARG_A(i0)+GETARG_A(i)); + return; + } + break; + case OP_POPERR: + if (c0 == OP_POPERR) { + s->iseq[s->pc-1] = MKOP_A(OP_POPERR, GETARG_A(i0)+GETARG_A(i)); + return; + } + break; + case OP_RETURN: + switch (c0) { + case OP_RETURN: + return; + case OP_MOVE: + s->iseq[s->pc-1] = MKOP_AB(OP_RETURN, GETARG_B(i0), OP_R_NORMAL); + return; + case OP_LOADI: + s->iseq[s->pc-1] = MKOP_AsBx(OP_LOADI, 0, GETARG_sBx(i0)); + genop(s, MKOP_AB(OP_RETURN, 0, OP_R_NORMAL)); + return; + case OP_ARRAY: + case OP_HASH: + case OP_RANGE: + case OP_AREF: + case OP_GETUPVAR: + s->iseq[s->pc-1] = MKOP_ABC(c0, 0, GETARG_B(i0), GETARG_C(i0)); + genop(s, MKOP_AB(OP_RETURN, 0, OP_R_NORMAL)); + return; + case OP_SETIV: + case OP_SETCV: + case OP_SETCONST: + case OP_SETMCNST: + case OP_SETUPVAR: + case OP_SETGLOBAL: + s->pc--; + genop_peep(s, i0, NOVAL); + i0 = s->iseq[s->pc-1]; + genop(s, MKOP_AB(OP_RETURN, GETARG_A(i0), OP_R_NORMAL)); + return; + case OP_LOADSYM: + case OP_GETGLOBAL: + case OP_GETIV: + case OP_GETCV: + case OP_GETCONST: + case OP_GETSPECIAL: + case OP_LOADL: + case OP_STRING: + s->iseq[s->pc-1] = MKOP_ABx(c0, 0, GETARG_Bx(i0)); + genop(s, MKOP_AB(OP_RETURN, 0, OP_R_NORMAL)); + return; + case OP_SCLASS: + s->iseq[s->pc-1] = MKOP_AB(c0, GETARG_A(i), GETARG_B(i0)); + genop(s, MKOP_AB(OP_RETURN, 0, OP_R_NORMAL)); + return; + case OP_LOADNIL: + case OP_LOADSELF: + case OP_LOADT: + case OP_LOADF: + case OP_OCLASS: + s->iseq[s->pc-1] = MKOP_A(c0, 0); + genop(s, MKOP_AB(OP_RETURN, 0, OP_R_NORMAL)); + return; + default: + break; + } + break; + case OP_ADD: + case OP_SUB: + if (c0 == OP_LOADI) { + int c = GETARG_sBx(i0); + + if (c1 == OP_SUB) c = -c; + if (c > 127 || c < -127) break; + if (0 <= c) + s->iseq[s->pc-1] = MKOP_ABC(OP_ADDI, GETARG_A(i), GETARG_B(i), c); + else + s->iseq[s->pc-1] = MKOP_ABC(OP_SUBI, GETARG_A(i), GETARG_B(i), -c); + return; + } + default: + break; + } + } + genop(s, i); +} + +static void +scope_error(codegen_scope *s) +{ + exit(1); +} + +static inline void +dispatch(codegen_scope *s, int pc) +{ + int diff = s->pc - pc; + mrb_code i = s->iseq[pc]; + int c = GET_OPCODE(i); + + s->lastlabel = s->pc; + switch (c) { + case OP_JMP: + case OP_JMPIF: + case OP_JMPNOT: + case OP_ONERR: + break; + default: +#ifdef ENABLE_STDIO + fprintf(stderr, "bug: dispatch on non JMP op\n"); +#endif + scope_error(s); + } + s->iseq[pc] = MKOP_AsBx(c, GETARG_A(i), diff); +} + +static void +dispatch_linked(codegen_scope *s, int pc) +{ + mrb_code i; + int pos; + + if (!pc) return; + for (;;) { + i = s->iseq[pc]; + pos = GETARG_sBx(i); + dispatch(s, pc); + if (!pos) break; + pc = pos; + } +} + +#define nregs_update do {if (s->sp > s->nregs) s->nregs = s->sp;} while (0) +static void +push_(codegen_scope *s) +{ + if (s->sp > 511) { + codegen_error(s, "too complex expression"); + } + s->sp++; + nregs_update; +} + +#define push() push_(s) +#define pop_(s) ((s)->sp--) +#define pop() pop_(s) +#define pop_n(n) (s->sp-=(n)) +#define cursp() (s->sp) + +static inline int +new_lit(codegen_scope *s, mrb_value val) +{ + int i; + + for (i=0; i<s->irep->plen; i++) { + if (mrb_obj_equal(s->mrb, s->irep->pool[i], val)) return i; + } + if (s->irep->plen == s->pcapa) { + s->pcapa *= 2; + s->irep->pool = (mrb_value *)codegen_realloc(s, s->irep->pool, sizeof(mrb_value)*s->pcapa); + } + s->irep->pool[s->irep->plen] = val; + i = s->irep->plen++; + + return i; +} + +static inline int +new_msym(codegen_scope *s, mrb_sym sym) +{ + int i, len; + + len = s->irep->slen; + if (len > 255) len = 255; + for (i=0; i<len; i++) { + if (s->irep->syms[i] == sym) return i; + if (s->irep->syms[i] == 0) break; + } + if (i > 255) { + codegen_error(s, "too many symbols (max 256)"); + } + s->irep->syms[i] = sym; + if (i == s->irep->slen) s->irep->slen++; + return i; +} + +static inline int +new_sym(codegen_scope *s, mrb_sym sym) +{ + int i; + + for (i=0; i<s->irep->slen; i++) { + if (s->irep->syms[i] == sym) return i; + } + if (s->irep->slen > 125 && s->irep->slen < 256) { + s->irep->syms = (mrb_sym *)codegen_realloc(s, s->irep->syms, sizeof(mrb_sym)*65536); + for (i = 0; i < 256 - s->irep->slen; i++) { + static const mrb_sym mrb_sym_zero = { 0 }; + s->irep->syms[i + s->irep->slen] = mrb_sym_zero; + } + s->irep->slen = 256; + } + s->irep->syms[s->irep->slen] = sym; + return s->irep->slen++; +} + +static int +node_len(node *tree) +{ + int n = 0; + + while (tree) { + n++; + tree = tree->cdr; + } + return n; +} + +#define sym(x) ((mrb_sym)(intptr_t)(x)) +#define lv_name(lv) sym((lv)->car) +static int +lv_idx(codegen_scope *s, mrb_sym id) +{ + node *lv = s->lv; + int n = 1; + + while (lv) { + if (lv_name(lv) == id) return n; + n++; + lv = lv->cdr; + } + return 0; +} + +static void +for_body(codegen_scope *s, node *tree) +{ + codegen_scope *prev = s; + int idx, base = s->idx; + struct loopinfo *lp; + node *n2; + mrb_code c; + + // generate receiver + codegen(s, tree->cdr->car, VAL); + // generate loop-block + s = scope_new(s->mrb, s, tree->car); + idx = s->idx; + + lp = loop_push(s, LOOP_FOR); + lp->pc1 = new_label(s); + + // generate loop variable + n2 = tree->car; + if (n2->car && !n2->car->cdr && !n2->cdr) { + genop(s, MKOP_Ax(OP_ENTER, 1<<18)); + gen_assignment(s, n2->car->car, 1, NOVAL); + } + else { + genop(s, MKOP_Ax(OP_ENTER, 1<<18)); + gen_vmassignment(s, n2, 1, VAL); + } + codegen(s, tree->cdr->cdr->car, VAL); + pop(); + if (s->pc > 0) { + c = s->iseq[s->pc-1]; + if (GET_OPCODE(c) != OP_RETURN || GETARG_B(c) != OP_R_NORMAL || s->pc == s->lastlabel) + genop_peep(s, MKOP_AB(OP_RETURN, cursp(), OP_R_NORMAL), NOVAL); + } + loop_pop(s, NOVAL); + scope_finish(s); + s = prev; + genop(s, MKOP_Abc(OP_LAMBDA, cursp(), idx - base, OP_L_BLOCK)); + pop(); + idx = new_msym(s, mrb_intern(s->mrb, "each")); + genop(s, MKOP_ABC(OP_SENDB, cursp(), idx, 0)); +} + +static int +lambda_body(codegen_scope *s, node *tree, int blk) +{ + int idx, base = s->idx; + mrb_code c; + + s = scope_new(s->mrb, s, tree->car); + idx = s->idx; + s->mscope = !blk; + + if (blk) { + struct loopinfo *lp = loop_push(s, LOOP_BLOCK); + lp->pc1 = new_label(s); + } + tree = tree->cdr; + if (tree->car) { + int ma, oa, ra, pa, ka, kd, ba, a; + int pos, i; + node *n, *opt; + + ma = node_len(tree->car->car); + n = tree->car->car; + while (n) { + n = n->cdr; + } + oa = node_len(tree->car->cdr->car); + ra = tree->car->cdr->cdr->car ? 1 : 0; + pa = node_len(tree->car->cdr->cdr->cdr->car); + ka = kd = 0; + ba = tree->car->cdr->cdr->cdr->cdr ? 1 : 0; + + a = ((ma & 0x1f) << 18) + | ((oa & 0x1f) << 13) + | ((ra & 1) << 12) + | ((pa & 0x1f) << 7) + | ((ka & 0x1f) << 2) + | ((kd & 1)<< 1) + | (ba & 1); + s->ainfo = (((ma+oa) & 0x3f) << 6) /* (12bits = 6:1:5) */ + | ((ra & 1) << 5) + | (pa & 0x1f); + genop(s, MKOP_Ax(OP_ENTER, a)); + pos = new_label(s); + for (i=0; i<oa; i++) { + new_label(s); + genop(s, MKOP_sBx(OP_JMP, 0)); + } + if (oa > 0) { + genop(s, MKOP_sBx(OP_JMP, 0)); + } + opt = tree->car->cdr->car; + i = 0; + while (opt) { + int idx; + + dispatch(s, pos+i); + codegen(s, opt->car->cdr, VAL); + idx = lv_idx(s, (mrb_sym)(intptr_t)opt->car->car); + pop(); + genop_peep(s, MKOP_AB(OP_MOVE, idx, cursp()), NOVAL); + i++; + opt = opt->cdr; + } + if (oa > 0) { + dispatch(s, pos+i); + } + } + codegen(s, tree->cdr->car, VAL); + pop(); + if (s->pc > 0) { + c = s->iseq[s->pc-1]; + if (GET_OPCODE(c) != OP_RETURN || GETARG_B(c) != OP_R_NORMAL || s->pc == s->lastlabel) { + if (s->nregs == 0) { + genop(s, MKOP_A(OP_LOADNIL, 0)); + genop(s, MKOP_AB(OP_RETURN, 0, OP_R_NORMAL)); + } + else { + genop_peep(s, MKOP_AB(OP_RETURN, cursp(), OP_R_NORMAL), NOVAL); + } + } + } + if (blk) { + loop_pop(s, NOVAL); + } + scope_finish(s); + + return idx - base; +} + +static int +scope_body(codegen_scope *s, node *tree) +{ + codegen_scope *scope = scope_new(s->mrb, s, tree->car); + int idx = scope->idx; + + codegen(scope, tree->cdr, VAL); + if (!s->iseq) { + genop(scope, MKOP_A(OP_STOP, 0)); + } + else { + if (scope->nregs == 0) { + genop(scope, MKOP_A(OP_LOADNIL, 0)); + genop(scope, MKOP_AB(OP_RETURN, 0, OP_R_NORMAL)); + } + else { + genop_peep(scope, MKOP_AB(OP_RETURN, scope->sp, OP_R_NORMAL), NOVAL); + } + } + scope_finish(scope); + + return idx - s->idx; +} + +static int +nosplat(node *t) +{ + while (t) { + if ((intptr_t)t->car->car == NODE_SPLAT) return FALSE; + t = t->cdr; + } + return TRUE; +} + +static mrb_sym +attrsym(codegen_scope *s, mrb_sym a) +{ + const char *name; + int len; + char *name2; + + name = mrb_sym2name_len(s->mrb, a, &len); + name2 = (char *)codegen_palloc(s, len+1); + memcpy(name2, name, len); + name2[len] = '='; + name2[len+1] = '\0'; + + return mrb_intern2(s->mrb, name2, len+1); +} + +static int +gen_values(codegen_scope *s, node *t) +{ + int n = 0; + + while (t) { + if ((intptr_t)t->car->car == NODE_SPLAT) { // splat mode + pop_n(n); + genop(s, MKOP_ABC(OP_ARRAY, cursp(), cursp(), n)); + push(); + codegen(s, t->car, VAL); + pop(); pop(); + genop(s, MKOP_AB(OP_ARYCAT, cursp(), cursp()+1)); + t = t->cdr; + while (t) { + push(); + codegen(s, t->car, VAL); + pop(); pop(); + if ((intptr_t)t->car->car == NODE_SPLAT) { + genop(s, MKOP_AB(OP_ARYCAT, cursp(), cursp()+1)); + } + else { + genop(s, MKOP_AB(OP_ARYPUSH, cursp(), cursp()+1)); + } + t = t->cdr; + } + return -1; + } + // normal (no splat) mode + codegen(s, t->car, VAL); + n++; + t = t->cdr; + } + return n; +} + +#define CALL_MAXARGS 127 + +static void +gen_call(codegen_scope *s, node *tree, mrb_sym name, int sp, int val) +{ + mrb_sym sym = name ? name : sym(tree->cdr->car); + int idx; + int n = 0, noop = 0, sendv = 0, blk = 0; + + codegen(s, tree->car, VAL); /* receiver */ + idx = new_msym(s, sym); + tree = tree->cdr->cdr->car; + if (tree) { + n = gen_values(s, tree->car); + if (n < 0) { + n = noop = sendv = 1; + push(); + } + } + if (sp) { + if (sendv) { + pop(); + genop(s, MKOP_AB(OP_ARYPUSH, cursp(), sp)); + push(); + } + else { + genop(s, MKOP_AB(OP_MOVE, cursp(), sp)); + push(); + n++; + } + } + if (tree && tree->cdr) { + noop = 1; + codegen(s, tree->cdr, VAL); + pop(); + } + else { + blk = cursp(); + } + pop_n(n+1); + { + int len; + const char *name = mrb_sym2name_len(s->mrb, sym, &len); + + if (!noop && len == 1 && name[0] == '+') { + genop_peep(s, MKOP_ABC(OP_ADD, cursp(), idx, n), val); + } + else if (!noop && len == 1 && name[0] == '-') { + genop_peep(s, MKOP_ABC(OP_SUB, cursp(), idx, n), val); + } + else if (!noop && len == 1 && name[0] == '*') { + genop(s, MKOP_ABC(OP_MUL, cursp(), idx, n)); + } + else if (!noop && len == 1 && name[0] == '/') { + genop(s, MKOP_ABC(OP_DIV, cursp(), idx, n)); + } + else if (!noop && len == 1 && name[0] == '<') { + genop(s, MKOP_ABC(OP_LT, cursp(), idx, n)); + } + else if (!noop && len == 2 && name[0] == '<' && name[1] == '=') { + genop(s, MKOP_ABC(OP_LE, cursp(), idx, n)); + } + else if (!noop && len == 1 && name[0] == '>') { + genop(s, MKOP_ABC(OP_GT, cursp(), idx, n)); + } + else if (!noop && len == 2 && name[0] == '>' && name[1] == '=') { + genop(s, MKOP_ABC(OP_GE, cursp(), idx, n)); + } + else if (!noop && len == 2 && name[0] == '=' && name[1] == '=') { + genop(s, MKOP_ABC(OP_EQ, cursp(), idx, n)); + } + else { + if (sendv) n = CALL_MAXARGS; + if (blk > 0) { /* no block */ + genop(s, MKOP_ABC(OP_SEND, cursp(), idx, n)); + } + else { + genop(s, MKOP_ABC(OP_SENDB, cursp(), idx, n)); + } + } + } + if (val) { + push(); + } +} + +static void +gen_assignment(codegen_scope *s, node *node, int sp, int val) +{ + int idx; + int type = (intptr_t)node->car; + + node = node->cdr; + switch ((intptr_t)type) { + case NODE_GVAR: + idx = new_sym(s, sym(node)); + genop_peep(s, MKOP_ABx(OP_SETGLOBAL, sp, idx), val); + break; + case NODE_LVAR: + idx = lv_idx(s, sym(node)); + if (idx > 0) { + if (idx != sp) { + genop_peep(s, MKOP_AB(OP_MOVE, idx, sp), val); + } + break; + } + else { /* upvar */ + int lv = 0; + codegen_scope *up = s->prev; + + while (up) { + idx = lv_idx(up, sym(node)); + if (idx > 0) { + genop_peep(s, MKOP_ABC(OP_SETUPVAR, sp, idx, lv), val); + break; + } + lv++; + up = up->prev; + } + // assert(up!=0); + } + break; + case NODE_IVAR: + idx = new_sym(s, sym(node)); + genop_peep(s, MKOP_ABx(OP_SETIV, sp, idx), val); + break; + case NODE_CVAR: + idx = new_sym(s, sym(node)); + genop_peep(s, MKOP_ABx(OP_SETCV, sp, idx), val); + break; + case NODE_CONST: + idx = new_sym(s, sym(node)); + genop_peep(s, MKOP_ABx(OP_SETCONST, sp, idx), val); + break; + case NODE_COLON2: + idx = new_sym(s, sym(node->cdr)); + genop_peep(s, MKOP_AB(OP_MOVE, cursp(), sp), NOVAL); + push(); + codegen(s, node->car, VAL); + pop_n(2); + genop_peep(s, MKOP_ABx(OP_SETMCNST, cursp(), idx), val); + break; + + case NODE_CALL: + push(); + gen_call(s, node, attrsym(s, sym(node->cdr->car)), sp, NOVAL); + pop(); + if (val) { + genop_peep(s, MKOP_AB(OP_MOVE, cursp(), sp), val); + } + break; + + default: +#ifdef ENABLE_STDIO + printf("unknown lhs %d\n", type); +#endif + break; + } + if (val) push(); +} + +static void +gen_vmassignment(codegen_scope *s, node *tree, int rhs, int val) +{ + int n = 0, post = 0; + node *t, *p; + + if (tree->car) { /* pre */ + t = tree->car; + n = 0; + while (t) { + genop(s, MKOP_ABC(OP_AREF, cursp(), rhs, n)); + gen_assignment(s, t->car, cursp(), NOVAL); + n++; + t = t->cdr; + } + } + t = tree->cdr; + if (t) { + if (t->cdr) { /* post count */ + p = t->cdr->car; + while (p) { + post++; + p = p->cdr; + } + } + if (val) { + genop(s, MKOP_AB(OP_MOVE, cursp(), rhs)); + push(); + } + pop(); + genop(s, MKOP_ABC(OP_APOST, cursp(), n, post)); + n = 1; + if (t->car) { /* rest */ + gen_assignment(s, t->car, cursp(), NOVAL); + } + if (t->cdr && t->cdr->car) { + t = t->cdr->car; + while (t) { + gen_assignment(s, t->car, cursp()+n, NOVAL); + t = t->cdr; + n++; + } + } + } +} + +static void +raise_error(codegen_scope *s, const char *msg) +{ + int idx = new_lit(s, mrb_str_new_cstr(s->mrb, msg)); + + genop(s, MKOP_ABx(OP_ERR, 1, idx)); +} + +static double +readint_float(codegen_scope *s, const char *p, int base) +{ + const char *e = p + strlen(p); + double f = 0; + int n; + + if (*p == '+') p++; + while (p < e) { + char c = *p; + c = tolower((unsigned char)c); + for (n=0; n<base; n++) { + if (mrb_digitmap[n] == c) { + f *= base; + f += n; + break; + } + } + if (n == base) { + codegen_error(s, "malformed readint input"); + } + p++; + } + return f; +} + +static void +codegen(codegen_scope *s, node *tree, int val) +{ + int nt; + + if (!tree) return; + nt = (intptr_t)tree->car; + s->lineno = tree->lineno; + tree = tree->cdr; + switch (nt) { + case NODE_BEGIN: + if (val && !tree) { + genop(s, MKOP_A(OP_LOADNIL, cursp())); + push(); + } + while (tree) { + codegen(s, tree->car, tree->cdr ? NOVAL : val); + tree = tree->cdr; + } + break; + + case NODE_RESCUE: + { + int onerr, noexc, exend, pos1, pos2, tmp; + struct loopinfo *lp; + + onerr = new_label(s); + genop(s, MKOP_Bx(OP_ONERR, 0)); + lp = loop_push(s, LOOP_BEGIN); + lp->pc1 = onerr; + if (tree->car) { + codegen(s, tree->car, val); + if (val) pop(); + } + lp->type = LOOP_RESCUE; + noexc = new_label(s); + genop(s, MKOP_Bx(OP_JMP, 0)); + dispatch(s, onerr); + tree = tree->cdr; + exend = 0; + pos1 = 0; + if (tree->car) { + node *n2 = tree->car; + int exc = cursp(); + + genop(s, MKOP_A(OP_RESCUE, exc)); + push(); + while (n2) { + node *n3 = n2->car; + node *n4 = n3->car; + + if (pos1) dispatch(s, pos1); + pos2 = 0; + do { + if (n4) { + codegen(s, n4->car, VAL); + } + else { + genop(s, MKOP_ABx(OP_GETCONST, cursp(), new_msym(s, mrb_intern(s->mrb, "StandardError")))); + push(); + } + genop(s, MKOP_AB(OP_MOVE, cursp(), exc)); + pop(); + genop(s, MKOP_ABC(OP_SEND, cursp(), new_msym(s, mrb_intern(s->mrb, "===")), 1)); + tmp = new_label(s); + genop(s, MKOP_AsBx(OP_JMPIF, cursp(), pos2)); + pos2 = tmp; + if (n4) { + n4 = n4->cdr; + } + } while (n4); + pos1 = new_label(s); + genop(s, MKOP_sBx(OP_JMP, 0)); + dispatch_linked(s, pos2); + + pop(); + if (n3->cdr->car) { + gen_assignment(s, n3->cdr->car, exc, NOVAL); + } + if (n3->cdr->cdr->car) { + codegen(s, n3->cdr->cdr->car, val); + } + tmp = new_label(s); + genop(s, MKOP_sBx(OP_JMP, exend)); + exend = tmp; + n2 = n2->cdr; + push(); + } + if (pos1) { + dispatch(s, pos1); + genop(s, MKOP_A(OP_RAISE, exc)); + } + } + pop(); + tree = tree->cdr; + dispatch(s, noexc); + genop(s, MKOP_A(OP_POPERR, 1)); + if (tree->car) { + codegen(s, tree->car, val); + } + dispatch_linked(s, exend); + loop_pop(s, NOVAL); + } + break; + + case NODE_ENSURE: + { + int idx; + int epush = s->pc; + + genop(s, MKOP_Bx(OP_EPUSH, 0)); + s->ensure_level++; + codegen(s, tree->car, val); + idx = scope_body(s, tree->cdr); + s->iseq[epush] = MKOP_Bx(OP_EPUSH, idx); + s->ensure_level--; + genop_peep(s, MKOP_A(OP_EPOP, 1), NOVAL); + } + break; + + case NODE_LAMBDA: + { + int idx = lambda_body(s, tree, 1); + + genop(s, MKOP_Abc(OP_LAMBDA, cursp(), idx, OP_L_LAMBDA)); + push(); + } + break; + + case NODE_BLOCK: + { + int idx = lambda_body(s, tree, 1); + + genop(s, MKOP_Abc(OP_LAMBDA, cursp(), idx, OP_L_BLOCK)); + push(); + } + break; + + case NODE_IF: + { + int pos1, pos2; + node *e = tree->cdr->cdr->car; + + codegen(s, tree->car, VAL); + pop(); + pos1 = new_label(s); + genop(s, MKOP_AsBx(OP_JMPNOT, cursp(), 0)); + + codegen(s, tree->cdr->car, val); + if (val && !(tree->cdr->car)) { + genop(s, MKOP_A(OP_LOADNIL, cursp())); + push(); + } + if (e) { + if (val) pop(); + pos2 = new_label(s); + genop(s, MKOP_sBx(OP_JMP, 0)); + dispatch(s, pos1); + codegen(s, e, val); + dispatch(s, pos2); + } + else { + if (val) { + pop(); + genop(s, MKOP_A(OP_LOADNIL, cursp())); + push(); + } + dispatch(s, pos1); + } + } + break; + + case NODE_AND: + { + int pos; + + codegen(s, tree->car, VAL); + pos = new_label(s); + pop(); + genop(s, MKOP_AsBx(OP_JMPNOT, cursp(), 0)); + codegen(s, tree->cdr, val); + dispatch(s, pos); + } + break; + + case NODE_OR: + { + int pos; + + codegen(s, tree->car, VAL); + pos = new_label(s); + pop(); + genop(s, MKOP_AsBx(OP_JMPIF, cursp(), 0)); + codegen(s, tree->cdr, val); + dispatch(s, pos); + } + break; + + case NODE_WHILE: + { + struct loopinfo *lp = loop_push(s, LOOP_NORMAL); + + lp->pc1 = new_label(s); + genop(s, MKOP_sBx(OP_JMP, 0)); + lp->pc2 = new_label(s); + codegen(s, tree->cdr, NOVAL); + dispatch(s, lp->pc1); + codegen(s, tree->car, VAL); + pop(); + genop(s, MKOP_AsBx(OP_JMPIF, cursp(), lp->pc2 - s->pc)); + + loop_pop(s, val); + } + break; + + case NODE_UNTIL: + { + struct loopinfo *lp = loop_push(s, LOOP_NORMAL); + + lp->pc1 = new_label(s); + genop(s, MKOP_sBx(OP_JMP, 0)); + lp->pc2 = new_label(s); + codegen(s, tree->cdr, NOVAL); + dispatch(s, lp->pc1); + codegen(s, tree->car, VAL); + pop(); + genop(s, MKOP_AsBx(OP_JMPNOT, cursp(), lp->pc2 - s->pc)); + + loop_pop(s, val); + } + break; + + case NODE_FOR: + for_body(s, tree); + if (val) push(); + break; + + case NODE_CASE: + { + int head = 0; + int pos1, pos2, pos3, tmp; + node *n; + + pos3 = 0; + if (tree->car) { + head = cursp(); + codegen(s, tree->car, VAL); + } + tree = tree->cdr; + while (tree) { + n = tree->car->car; + pos1 = pos2 = 0; + while (n) { + codegen(s, n->car, VAL); + if (head) { + genop(s, MKOP_AB(OP_MOVE, cursp(), head)); + pop(); + genop(s, MKOP_ABC(OP_SEND, cursp(), new_msym(s, mrb_intern(s->mrb, "===")), 1)); + } + else { + pop(); + } + tmp = new_label(s); + genop(s, MKOP_AsBx(OP_JMPIF, cursp(), pos2)); + pos2 = tmp; + n = n->cdr; + } + if (tree->car->car) { + pos1 = new_label(s); + genop(s, MKOP_sBx(OP_JMP, 0)); + dispatch_linked(s, pos2); + } + codegen(s, tree->car->cdr, val); + if (val) pop(); + tmp = new_label(s); + genop(s, MKOP_sBx(OP_JMP, pos3)); + pos3 = tmp; + if (pos1) dispatch(s, pos1); + tree = tree->cdr; + } + if (val) { + genop(s, MKOP_A(OP_LOADNIL, cursp())); + push(); + } + if (pos3) dispatch_linked(s, pos3); + } + break; + + case NODE_SCOPE: + scope_body(s, tree); + break; + + case NODE_FCALL: + case NODE_CALL: + gen_call(s, tree, 0, 0, val); + break; + + case NODE_DOT2: + codegen(s, tree->car, VAL); + codegen(s, tree->cdr, VAL); + pop(); pop(); + if (val) { + genop(s, MKOP_ABC(OP_RANGE, cursp(), cursp(), 0)); + push(); + } + break; + + case NODE_DOT3: + codegen(s, tree->car, VAL); + codegen(s, tree->cdr, VAL); + pop(); pop(); + if (val) { + genop(s, MKOP_ABC(OP_RANGE, cursp(), cursp(), 1)); + push(); + } + break; + + case NODE_COLON2: + { + int sym = new_sym(s, sym(tree->cdr)); + + codegen(s, tree->car, VAL); + pop(); + genop(s, MKOP_ABx(OP_GETMCNST, cursp(), sym)); + push(); + } + break; + + case NODE_COLON3: + { + int sym = new_sym(s, sym(tree)); + + genop(s, MKOP_A(OP_OCLASS, cursp())); + genop(s, MKOP_ABx(OP_GETMCNST, cursp(), sym)); + push(); + } + break; + + case NODE_ARRAY: + { + int n; + + n = gen_values(s, tree); + if (n >= 0) { + pop_n(n); + if (val) { + genop(s, MKOP_ABC(OP_ARRAY, cursp(), cursp(), n)); + push(); + } + } + else if (val) { + push(); + } + } + break; + + case NODE_HASH: + { + int len = 0; + + while (tree) { + codegen(s, tree->car->car, VAL); + codegen(s, tree->car->cdr, VAL); + len++; + tree = tree->cdr; + } + pop_n(len*2); + if (val) { + genop(s, MKOP_ABC(OP_HASH, cursp(), cursp(), len)); + push(); + } + } + break; + + case NODE_SPLAT: + codegen(s, tree, VAL); + break; + + case NODE_ASGN: + codegen(s, tree->cdr, VAL); + pop(); + gen_assignment(s, tree->car, cursp(), val); + break; + + case NODE_MASGN: + { + int len = 0, n = 0, post = 0; + node *t = tree->cdr, *p; + int rhs = cursp(); + + if ((intptr_t)t->car == NODE_ARRAY && nosplat(t->cdr)) { + // fixed rhs + t = t->cdr; + while (t) { + codegen(s, t->car, VAL); + len++; + t = t->cdr; + } + tree = tree->car; + if (tree->car) { /* pre */ + t = tree->car; + n = 0; + while (t) { + gen_assignment(s, t->car, rhs+n, NOVAL); + n++; + t = t->cdr; + } + } + t = tree->cdr; + if (t) { + if (t->cdr) { /* post count */ + p = t->cdr->car; + while (p) { + post++; + p = p->cdr; + } + } + if (t->car) { /* rest (len - pre - post) */ + int rn = len - post - n; + + genop(s, MKOP_ABC(OP_ARRAY, cursp(), rhs+n, rn)); + gen_assignment(s, t->car, cursp(), NOVAL); + n += rn; + } + if (t->cdr && t->cdr->car) { + t = t->cdr->car; + while (n<len) { + gen_assignment(s, t->car, rhs+n, NOVAL); + t = t->cdr; + n++; + } + } + } + pop_n(len); + if (val) { + genop(s, MKOP_ABC(OP_ARRAY, rhs, rhs, len)); + push(); + } + } + else { + // variable rhs + codegen(s, t, VAL); + gen_vmassignment(s, tree->car, rhs, val); + if (!val) pop(); + } + } + break; + + case NODE_OP_ASGN: + { + mrb_sym sym = sym(tree->cdr->car); + int len; + const char *name = mrb_sym2name_len(s->mrb, sym, &len); + int idx; + + codegen(s, tree->car, VAL); + if (len == 2 && + ((name[0] == '|' && name[1] == '|') || + (name[0] == '&' && name[1] == '&'))) { + int pos; + + pop(); + pos = new_label(s); + genop(s, MKOP_AsBx(name[0] == '|' ? OP_JMPIF : OP_JMPNOT, cursp(), 0)); + codegen(s, tree->cdr->cdr->car, VAL); + pop(); + gen_assignment(s, tree->car, cursp(), val); + dispatch(s, pos); + break; + } + codegen(s, tree->cdr->cdr->car, VAL); + pop(); pop(); + + idx = new_msym(s, sym); + if (len == 1 && name[0] == '+') { + genop_peep(s, MKOP_ABC(OP_ADD, cursp(), idx, 1), val); + } + else if (len == 1 && name[0] == '-') { + genop_peep(s, MKOP_ABC(OP_SUB, cursp(), idx, 1), val); + } + else if (len == 1 && name[0] == '<') { + genop(s, MKOP_ABC(OP_LT, cursp(), idx, 1)); + } + else if (len == 2 && name[0] == '<' && name[1] == '=') { + genop(s, MKOP_ABC(OP_LE, cursp(), idx, 1)); + } + else if (len == 1 && name[0] == '>') { + genop(s, MKOP_ABC(OP_GT, cursp(), idx, 1)); + } + else if (len == 2 && name[0] == '>' && name[1] == '=') { + genop(s, MKOP_ABC(OP_GE, cursp(), idx, 1)); + } + else { + genop(s, MKOP_ABC(OP_SEND, cursp(), idx, 1)); + } + } + gen_assignment(s, tree->car, cursp(), val); + break; + + case NODE_SUPER: + { + int n = 0, noop = 0, sendv = 0; + + push(); /* room for receiver */ + if (tree) { + node *args = tree->car; + if (args) { + n = gen_values(s, args); + if (n < 0) { + n = noop = sendv = 1; + push(); + } + } + } + if (tree && tree->cdr) { + codegen(s, tree->cdr, VAL); + pop(); + } + else { + genop(s, MKOP_A(OP_LOADNIL, cursp())); + } + pop_n(n+1); + if (sendv) n = CALL_MAXARGS; + genop(s, MKOP_ABC(OP_SUPER, cursp(), 0, n)); + if (val) push(); + } + break; + + case NODE_ZSUPER: + { + codegen_scope *s2 = s; + int lv = 0, ainfo = 0; + + push(); /* room for receiver */ + while (!s2->mscope) { + lv++; + s2 = s2->prev; + if (!s2) break; + } + if (s2) ainfo = s2->ainfo; + genop(s, MKOP_ABx(OP_ARGARY, cursp(), (ainfo<<4)|(lv & 0xf))); + if (tree && tree->cdr) { + push(); + codegen(s, tree->cdr, VAL); + pop_n(2); + } + pop(); + genop(s, MKOP_ABC(OP_SUPER, cursp(), 0, CALL_MAXARGS)); + if (val) push(); + } + break; + + case NODE_RETURN: + codegen(s, tree, VAL); + pop(); + if (s->loop) { + genop(s, MKOP_AB(OP_RETURN, cursp(), OP_R_RETURN)); + } + else { + genop_peep(s, MKOP_AB(OP_RETURN, cursp(), OP_R_NORMAL), NOVAL); + } + push(); + break; + + case NODE_YIELD: + { + codegen_scope *s2 = s; + int lv = 0, ainfo = 0; + int n = 0, sendv = 0; + + while (!s2->mscope) { + lv++; + s2 = s2->prev; + if (!s2) break; + } + if (s2) ainfo = s2->ainfo; + genop(s, MKOP_ABx(OP_BLKPUSH, cursp(), (ainfo<<4)|(lv & 0xf))); + push(); + if (tree) { + n = gen_values(s, tree); + if (n < 0) { + n = sendv = 1; + push(); + } + } + pop_n(n+1); + if (sendv) n = CALL_MAXARGS; + genop(s, MKOP_ABC(OP_SEND, cursp(), new_msym(s, mrb_intern(s->mrb, "call")), n)); + if (val) push(); + } + break; + + case NODE_BREAK: + loop_break(s, tree); + if (val) push(); + break; + + case NODE_NEXT: + if (!s->loop) { + raise_error(s, "unexpected next"); + } + else if (s->loop->type == LOOP_NORMAL) { + if (s->ensure_level > s->loop->ensure_level) { + genop_peep(s, MKOP_A(OP_EPOP, s->ensure_level - s->loop->ensure_level), NOVAL); + } + codegen(s, tree, NOVAL); + genop(s, MKOP_sBx(OP_JMP, s->loop->pc1 - s->pc)); + } + else { + if (tree) { + codegen(s, tree, VAL); + pop(); + } + genop_peep(s, MKOP_AB(OP_RETURN, cursp(), OP_R_NORMAL), NOVAL); + } + if (val) push(); + break; + + case NODE_REDO: + if (!s->loop) { + raise_error(s, "unexpected redo"); + } + else { + if (s->ensure_level > s->loop->ensure_level) { + genop_peep(s, MKOP_A(OP_EPOP, s->ensure_level - s->loop->ensure_level), NOVAL); + } + genop(s, MKOP_sBx(OP_JMP, s->loop->pc2 - s->pc)); + } + break; + + case NODE_RETRY: + { + const char *msg = "unexpected retry"; + + if (!s->loop) { + raise_error(s, msg); + } + else { + struct loopinfo *lp = s->loop; + int n = 0; + + while (lp && lp->type != LOOP_RESCUE) { + if (lp->type == LOOP_BEGIN) { + n++; + } + lp = lp->prev; + } + if (!lp) { + raise_error(s, msg); + } + else { + if (n > 0) { + while (n--) { + genop_peep(s, MKOP_A(OP_POPERR, 1), NOVAL); + } + } + if (s->ensure_level > lp->ensure_level) { + genop_peep(s, MKOP_A(OP_EPOP, s->ensure_level - lp->ensure_level), NOVAL); + } + genop(s, MKOP_sBx(OP_JMP, lp->pc1 - s->pc)); + } + } + } + break; + + case NODE_LVAR: + if (val) { + int idx = lv_idx(s, sym(tree)); + + if (idx > 0) { + genop(s, MKOP_AB(OP_MOVE, cursp(), idx)); + } + else { + int lv = 0; + codegen_scope *up = s->prev; + + while (up) { + idx = lv_idx(up, sym(tree)); + if (idx > 0) { + genop(s, MKOP_ABC(OP_GETUPVAR, cursp(), idx, lv)); + break; + } + lv++; + up = up->prev; + } + } + push(); + } + break; + + case NODE_GVAR: + { + int sym = new_sym(s, sym(tree)); + + genop(s, MKOP_ABx(OP_GETGLOBAL, cursp(), sym)); + push(); + } + break; + + case NODE_IVAR: + { + int sym = new_sym(s, sym(tree)); + + genop(s, MKOP_ABx(OP_GETIV, cursp(), sym)); + push(); + } + break; + + case NODE_CVAR: + { + int sym = new_sym(s, sym(tree)); + + genop(s, MKOP_ABx(OP_GETCV, cursp(), sym)); + push(); + } + break; + + case NODE_CONST: + { + int sym = new_sym(s, sym(tree)); + + genop(s, MKOP_ABx(OP_GETCONST, cursp(), sym)); + push(); + } + break; + + case NODE_DEFINED: + codegen(s, tree, VAL); + break; + + case NODE_BACK_REF: + { + char buf[4]; + int len; + int sym; + + len = snprintf(buf, sizeof(buf), "$%c", (int)(intptr_t)tree); + sym = new_sym(s, mrb_intern2(s->mrb, buf, len)); + genop(s, MKOP_ABx(OP_GETGLOBAL, cursp(), sym)); + push(); + } + break; + + case NODE_NTH_REF: + { + char buf[4]; + int len; + int sym; + + len = snprintf(buf, sizeof(buf), "$%d", (int)(intptr_t)tree); + sym = new_sym(s, mrb_intern2(s->mrb, buf, len)); + genop(s, MKOP_ABx(OP_GETGLOBAL, cursp(), sym)); + push(); + } + break; + + case NODE_ARG: + // should not happen + break; + + case NODE_BLOCK_ARG: + codegen(s, tree, VAL); + break; + + case NODE_INT: + if (val) { + char *p = (char*)tree->car; + int base = (intptr_t)tree->cdr->car; + double f; + mrb_int i; + mrb_code co; + + f = readint_float(s, p, base); + if (!FIXABLE(f)) { + int off = new_lit(s, mrb_float_value(f)); + + genop(s, MKOP_ABx(OP_LOADL, cursp(), off)); + } + else { + i = (mrb_int)f; + if (i < MAXARG_sBx && i > -MAXARG_sBx) { + co = MKOP_AsBx(OP_LOADI, cursp(), i); + } + else { + int off = new_lit(s, mrb_fixnum_value(i)); + co = MKOP_ABx(OP_LOADL, cursp(), off); + } + genop(s, co); + } + push(); + } + break; + + case NODE_FLOAT: + if (val) { + char *p = (char*)tree; + mrb_float f = str_to_mrb_float(p); + int off = new_lit(s, mrb_float_value(f)); + + genop(s, MKOP_ABx(OP_LOADL, cursp(), off)); + push(); + } + break; + + case NODE_NEGATE: + { + nt = (intptr_t)tree->car; + tree = tree->cdr; + switch (nt) { + case NODE_FLOAT: + { + char *p = (char*)tree; + mrb_float f = str_to_mrb_float(p); + int off = new_lit(s, mrb_float_value(-f)); + + genop(s, MKOP_ABx(OP_LOADL, cursp(), off)); + push(); + } + break; + + case NODE_INT: + { + char *p = (char*)tree->car; + int base = (intptr_t)tree->cdr->car; + mrb_float f; + mrb_int i; + mrb_code co; + + f = readint_float(s, p, base); + if (!FIXABLE(f)) { + int off = new_lit(s, mrb_float_value(-f)); + + genop(s, MKOP_ABx(OP_LOADL, cursp(), off)); + } + else { + i = (mrb_int)-f; + if (i < MAXARG_sBx && i > -MAXARG_sBx) { + co = MKOP_AsBx(OP_LOADI, cursp(), i); + } + else { + int off = new_lit(s, mrb_fixnum_value(i)); + co = MKOP_ABx(OP_LOADL, cursp(), off); + } + genop(s, co); + } + push(); + } + break; + + default: + { + int sym = new_msym(s, mrb_intern(s->mrb, "-")); + + genop(s, MKOP_ABx(OP_LOADI, cursp(), 0)); + push(); + codegen(s, tree, VAL); + pop(); pop(); + genop(s, MKOP_ABC(OP_SUB, cursp(), sym, 2)); + } + break; + } + } + break; + + case NODE_STR: + if (val) { + char *p = (char*)tree->car; + size_t len = (intptr_t)tree->cdr; + int ai = mrb_gc_arena_save(s->mrb); + int off = new_lit(s, mrb_str_new(s->mrb, p, len)); + + mrb_gc_arena_restore(s->mrb, ai); + genop(s, MKOP_ABx(OP_STRING, cursp(), off)); + push(); + } + break; + + case NODE_DSTR: + if (val) { + node *n = tree; + + codegen(s, n->car, VAL); + n = n->cdr; + while (n) { + codegen(s, n->car, VAL); + pop(); pop(); + genop(s, MKOP_AB(OP_STRCAT, cursp(), cursp()+1)); + push(); + n = n->cdr; + } + } + else { + node *n = tree; + + while (n) { + if ((intptr_t)n->car->car != NODE_STR) { + codegen(s, n->car, NOVAL); + } + n = n->cdr; + } + } + break; + + case NODE_SYM: + if (val) { + int sym = new_sym(s, sym(tree)); + + genop(s, MKOP_ABx(OP_LOADSYM, cursp(), sym)); + push(); + } + break; + + case NODE_DSYM: + codegen(s, tree, val); + if (val) { + pop(); + genop(s, MKOP_ABC(OP_SEND, cursp(), new_msym(s, mrb_intern(s->mrb, "intern")), 0)); + push(); + } + break; + + case NODE_SELF: + if (val) { + genop(s, MKOP_A(OP_LOADSELF, cursp())); + push(); + } + break; + + case NODE_NIL: + if (val) { + genop(s, MKOP_A(OP_LOADNIL, cursp())); + push(); + } + break; + + case NODE_TRUE: + if (val) { + genop(s, MKOP_A(OP_LOADT, cursp())); + push(); + } + break; + + case NODE_FALSE: + if (val) { + genop(s, MKOP_A(OP_LOADF, cursp())); + push(); + } + break; + + case NODE_ALIAS: + { + int a = new_msym(s, sym(tree->car)); + int b = new_msym(s, sym(tree->cdr)); + int c = new_msym(s, mrb_intern(s->mrb, "alias_method")); + + genop(s, MKOP_A(OP_TCLASS, cursp())); + push(); + genop(s, MKOP_ABx(OP_LOADSYM, cursp(), a)); + push(); + genop(s, MKOP_ABx(OP_LOADSYM, cursp(), b)); + push(); + genop(s, MKOP_A(OP_LOADNIL, cursp())); + pop_n(3); + genop(s, MKOP_ABC(OP_SEND, cursp(), c, 2)); + if (val) { + push(); + } + } + break; + + case NODE_UNDEF: + { + int sym = new_msym(s, sym(tree)); + int undef = new_msym(s, mrb_intern(s->mrb, "undef_method")); + + genop(s, MKOP_A(OP_TCLASS, cursp())); + push(); + genop(s, MKOP_ABx(OP_LOADSYM, cursp(), sym)); + push(); + genop(s, MKOP_A(OP_LOADNIL, cursp())); + pop_n(2); + genop(s, MKOP_ABC(OP_SEND, cursp(), undef, 2)); + if (val) { + push(); + } + } + break; + + case NODE_CLASS: + { + int idx; + + if (tree->car->car == (node*)0) { + genop(s, MKOP_A(OP_LOADNIL, cursp())); + push(); + } + else if (tree->car->car == (node*)1) { + genop(s, MKOP_A(OP_OCLASS, cursp())); + push(); + } + else { + codegen(s, tree->car->car, VAL); + } + if (tree->cdr->car) { + codegen(s, tree->cdr->car, VAL); + } + else { + genop(s, MKOP_A(OP_LOADNIL, cursp())); + push(); + } + pop(); pop(); + idx = new_msym(s, sym(tree->car->cdr)); + genop(s, MKOP_AB(OP_CLASS, cursp(), idx)); + idx = scope_body(s, tree->cdr->cdr->car); + genop(s, MKOP_ABx(OP_EXEC, cursp(), idx)); + if (val) { + push(); + } + } + break; + + case NODE_MODULE: + { + int idx; + + if (tree->car->car == (node*)0) { + genop(s, MKOP_A(OP_LOADNIL, cursp())); + push(); + } + else if (tree->car->car == (node*)1) { + genop(s, MKOP_A(OP_OCLASS, cursp())); + push(); + } + else { + codegen(s, tree->car->car, VAL); + } + pop(); + idx = new_msym(s, sym(tree->car->cdr)); + genop(s, MKOP_AB(OP_MODULE, cursp(), idx)); + idx = scope_body(s, tree->cdr->car); + genop(s, MKOP_ABx(OP_EXEC, cursp(), idx)); + if (val) { + push(); + } + } + break; + + case NODE_SCLASS: + { + int idx; + + codegen(s, tree->car, VAL); + pop(); + genop(s, MKOP_AB(OP_SCLASS, cursp(), cursp())); + idx = scope_body(s, tree->cdr->car); + genop(s, MKOP_ABx(OP_EXEC, cursp(), idx)); + if (val) { + push(); + } + } + break; + + case NODE_DEF: + { + int sym = new_msym(s, sym(tree->car)); + int idx = lambda_body(s, tree->cdr, 0); + + genop(s, MKOP_A(OP_TCLASS, cursp())); + push(); + genop(s, MKOP_Abc(OP_LAMBDA, cursp(), idx, OP_L_METHOD)); + pop(); + genop(s, MKOP_AB(OP_METHOD, cursp(), sym)); + if (val) { + genop(s, MKOP_A(OP_LOADNIL, cursp())); + } + } + break; + + case NODE_SDEF: + { + node *recv = tree->car; + int sym = new_msym(s, sym(tree->cdr->car)); + int idx = lambda_body(s, tree->cdr->cdr, 0); + + codegen(s, recv, VAL); + pop(); + genop(s, MKOP_AB(OP_SCLASS, cursp(), cursp())); + push(); + genop(s, MKOP_Abc(OP_LAMBDA, cursp(), idx, OP_L_METHOD)); + pop(); + genop(s, MKOP_AB(OP_METHOD, cursp(), sym)); + if (val) { + genop(s, MKOP_A(OP_LOADNIL, cursp())); + } + } + break; + + case NODE_POSTEXE: + codegen(s, tree, NOVAL); + break; + + default: + break; + } +} + +static codegen_scope* +scope_new(mrb_state *mrb, codegen_scope *prev, node *lv) +{ + static const codegen_scope codegen_scope_zero = { 0 }; + mrb_pool *pool = mrb_pool_open(mrb); + codegen_scope *p = (codegen_scope *)mrb_pool_alloc(pool, sizeof(codegen_scope)); + + if (!p) return 0; + *p = codegen_scope_zero; + p->mrb = mrb; + p->mpool = pool; + if (!prev) return p; + p->prev = prev; + p->ainfo = -1; + p->mscope = 0; + + p->irep = mrb_add_irep(mrb); + p->idx = p->irep->idx; + + p->icapa = 1024; + p->iseq = (mrb_code*)mrb_malloc(mrb, sizeof(mrb_code)*p->icapa); + + p->pcapa = 32; + p->irep->pool = (mrb_value*)mrb_malloc(mrb, sizeof(mrb_value)*p->pcapa); + p->irep->plen = 0; + + p->scapa = 256; + p->irep->syms = (mrb_sym*)mrb_malloc(mrb, sizeof(mrb_sym)*256); + p->irep->slen = 0; + + p->lv = lv; + p->sp += node_len(lv)+1; /* add self */ + p->nlocals = p->sp; + p->ai = mrb_gc_arena_save(mrb); + + p->filename = prev->filename; + if (p->filename) { + p->lines = (short*)mrb_malloc(mrb, sizeof(short)*p->icapa); + } + p->lineno = prev->lineno; + return p; +} + +static void +scope_finish(codegen_scope *s) +{ + mrb_state *mrb = s->mrb; + mrb_irep *irep = s->irep; + + irep->flags = 0; + if (s->iseq) { + irep->iseq = (mrb_code *)codegen_realloc(s, s->iseq, sizeof(mrb_code)*s->pc); + irep->ilen = s->pc; + if (s->lines) { + irep->lines = (short *)codegen_realloc(s, s->lines, sizeof(short)*s->pc); + } + else { + irep->lines = 0; + } + } + irep->pool = (mrb_value *)codegen_realloc(s, irep->pool, sizeof(mrb_value)*irep->plen); + irep->syms = (mrb_sym *)codegen_realloc(s, irep->syms, sizeof(mrb_sym)*irep->slen); + if (s->filename) { + irep->filename = s->filename; + } + + irep->nlocals = s->nlocals; + irep->nregs = s->nregs; + + mrb_gc_arena_restore(mrb, s->ai); + mrb_pool_close(s->mpool); +} + +static struct loopinfo* +loop_push(codegen_scope *s, enum looptype t) +{ + struct loopinfo *p = (struct loopinfo *)codegen_palloc(s, sizeof(struct loopinfo)); + + p->type = t; + p->pc1 = p->pc2 = p->pc3 = 0; + p->prev = s->loop; + p->ensure_level = s->ensure_level; + p->acc = cursp(); + s->loop = p; + + return p; +} + +static void +loop_break(codegen_scope *s, node *tree) +{ + if (!s->loop) { + codegen(s, tree, NOVAL); + raise_error(s, "unexpected break"); + } + else { + struct loopinfo *loop; + + if (tree) { + codegen(s, tree, VAL); + pop(); + } + + loop = s->loop; + while (loop->type == LOOP_BEGIN) { + genop_peep(s, MKOP_A(OP_POPERR, 1), NOVAL); + loop = loop->prev; + } + while (loop->type == LOOP_RESCUE) { + loop = loop->prev; + } + if (loop->type == LOOP_NORMAL) { + int tmp; + + if (s->ensure_level > s->loop->ensure_level) { + genop_peep(s, MKOP_A(OP_EPOP, s->ensure_level - s->loop->ensure_level), NOVAL); + } + if (tree) { + genop_peep(s, MKOP_AB(OP_MOVE, loop->acc, cursp()), NOVAL); + } + tmp = new_label(s); + genop(s, MKOP_sBx(OP_JMP, loop->pc3)); + loop->pc3 = tmp; + } + else { + genop(s, MKOP_AB(OP_RETURN, cursp(), OP_R_BREAK)); + } + } +} + +static void +loop_pop(codegen_scope *s, int val) +{ + if (val) { + genop(s, MKOP_A(OP_LOADNIL, cursp())); + } + dispatch_linked(s, s->loop->pc3); + s->loop = s->loop->prev; + if (val) push(); +} + +static void +codedump(mrb_state *mrb, int n) +{ +#ifdef ENABLE_STDIO + mrb_irep *irep = mrb->irep[n]; + int i; + mrb_code c; + + if (!irep) return; + printf("irep %d nregs=%d nlocals=%d pools=%d syms=%d\n", n, + irep->nregs, irep->nlocals, irep->plen, irep->slen); + for (i=0; i<irep->ilen; i++) { + printf("%03d ", i); + c = irep->iseq[i]; + switch (GET_OPCODE(c)) { + case OP_NOP: + printf("OP_NOP\n"); + break; + case OP_MOVE: + printf("OP_MOVE\tR%d\tR%d\n", GETARG_A(c), GETARG_B(c)); + break; + case OP_LOADL: + printf("OP_LOADL\tR%d\tL(%d)\n", GETARG_A(c), GETARG_Bx(c)); + break; + case OP_LOADI: + printf("OP_LOADI\tR%d\t%d\n", GETARG_A(c), GETARG_sBx(c)); + break; + case OP_LOADSYM: + printf("OP_LOADSYM\tR%d\t:%s\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_Bx(c)])); + break; + case OP_LOADNIL: + printf("OP_LOADNIL\tR%d\n", GETARG_A(c)); + break; + case OP_LOADSELF: + printf("OP_LOADSELF\tR%d\n", GETARG_A(c)); + break; + case OP_LOADT: + printf("OP_LOADT\tR%d\n", GETARG_A(c)); + break; + case OP_LOADF: + printf("OP_LOADF\tR%d\n", GETARG_A(c)); + break; + case OP_GETGLOBAL: + printf("OP_GETGLOBAL\tR%d\t:%s\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_Bx(c)])); + break; + case OP_SETGLOBAL: + printf("OP_SETGLOBAL\t:%s\tR%d\n", + mrb_sym2name(mrb, irep->syms[GETARG_Bx(c)]), + GETARG_A(c)); + break; + case OP_GETCONST: + printf("OP_GETCONST\tR%d\t:%s\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_Bx(c)])); + break; + case OP_SETCONST: + printf("OP_SETCONST\t:%s\tR%d\n", + mrb_sym2name(mrb, irep->syms[GETARG_Bx(c)]), + GETARG_A(c)); + break; + case OP_GETMCNST: + printf("OP_GETMCNST\tR%d\tR%d::%s\n", GETARG_A(c), GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_Bx(c)])); + break; + case OP_SETMCNST: + printf("OP_SETMCNST\tR%d::%s\tR%d\n", GETARG_A(c)+1, + mrb_sym2name(mrb, irep->syms[GETARG_Bx(c)]), + GETARG_A(c)); + break; + case OP_GETIV: + printf("OP_GETIV\tR%d\t%s\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_Bx(c)])); + break; + case OP_SETIV: + printf("OP_SETIV\t%s\tR%d\n", + mrb_sym2name(mrb, irep->syms[GETARG_Bx(c)]), + GETARG_A(c)); + break; + case OP_GETUPVAR: + printf("OP_GETUPVAR\tR%d\t%d\t%d\n", + GETARG_A(c), GETARG_B(c), GETARG_C(c)); + break; + case OP_SETUPVAR: + printf("OP_SETUPVAR\tR%d\t%d\t%d\n", + GETARG_A(c), GETARG_B(c), GETARG_C(c)); + break; + case OP_GETCV: + printf("OP_GETCV\tR%d\t%s\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_Bx(c)])); + break; + case OP_SETCV: + printf("OP_SETCV\t%s\tR%d\n", + mrb_sym2name(mrb, irep->syms[GETARG_Bx(c)]), + GETARG_A(c)); + break; + case OP_JMP: + printf("OP_JMP\t\t%03d\n", i+GETARG_sBx(c)); + break; + case OP_JMPIF: + printf("OP_JMPIF\tR%d\t%03d\n", GETARG_A(c), i+GETARG_sBx(c)); + break; + case OP_JMPNOT: + printf("OP_JMPNOT\tR%d\t%03d\n", GETARG_A(c), i+GETARG_sBx(c)); + break; + case OP_SEND: + printf("OP_SEND\tR%d\t:%s\t%d\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)]), + GETARG_C(c)); + break; + case OP_SENDB: + printf("OP_SENDB\tR%d\t:%s\t%d\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)]), + GETARG_C(c)); + break; + case OP_TAILCALL: + printf("OP_TAILCALL\tR%d\t:%s\t%d\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)]), + GETARG_C(c)); + break; + case OP_SUPER: + printf("OP_SUPER\tR%d\t%d\n", GETARG_A(c), + GETARG_C(c)); + break; + case OP_ARGARY: + printf("OP_ARGARY\tR%d\t%d:%d:%d:%d\n", GETARG_A(c), + (GETARG_Bx(c)>>10)&0x3f, + (GETARG_Bx(c)>>9)&0x1, + (GETARG_Bx(c)>>4)&0x1f, + (GETARG_Bx(c)>>0)&0xf); + break; + + case OP_ENTER: + printf("OP_ENTER\t%d:%d:%d:%d:%d:%d:%d\n", + (GETARG_Ax(c)>>18)&0x1f, + (GETARG_Ax(c)>>13)&0x1f, + (GETARG_Ax(c)>>12)&0x1, + (GETARG_Ax(c)>>7)&0x1f, + (GETARG_Ax(c)>>2)&0x1f, + (GETARG_Ax(c)>>1)&0x1, + GETARG_Ax(c) & 0x1); + break; + case OP_RETURN: + printf("OP_RETURN\tR%d", GETARG_A(c)); + switch (GETARG_B(c)) { + case OP_R_NORMAL: + printf("\n"); break; + case OP_R_RETURN: + printf("\treturn\n"); break; + case OP_R_BREAK: + printf("\tbreak\n"); break; + default: + printf("\tbroken\n"); break; + break; + } + break; + case OP_BLKPUSH: + printf("OP_BLKPUSH\tR%d\t%d:%d:%d:%d\n", GETARG_A(c), + (GETARG_Bx(c)>>10)&0x3f, + (GETARG_Bx(c)>>9)&0x1, + (GETARG_Bx(c)>>4)&0x1f, + (GETARG_Bx(c)>>0)&0xf); + break; + + case OP_LAMBDA: + printf("OP_LAMBDA\tR%d\tI(%+d)\t%d\n", GETARG_A(c), GETARG_b(c), GETARG_c(c)); + break; + case OP_RANGE: + printf("OP_RANGE\tR%d\tR%d\t%d\n", GETARG_A(c), GETARG_B(c), GETARG_C(c)); + break; + case OP_METHOD: + printf("OP_METHOD\tR%d\t:%s\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)])); + break; + + case OP_ADD: + printf("OP_ADD\tR%d\t:%s\t%d\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)]), + GETARG_C(c)); + break; + case OP_ADDI: + printf("OP_ADDI\tR%d\t:%s\t%d\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)]), + GETARG_C(c)); + break; + case OP_SUB: + printf("OP_SUB\tR%d\t:%s\t%d\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)]), + GETARG_C(c)); + break; + case OP_SUBI: + printf("OP_SUBI\tR%d\t:%s\t%d\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)]), + GETARG_C(c)); + break; + case OP_MUL: + printf("OP_MUL\tR%d\t:%s\t%d\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)]), + GETARG_C(c)); + break; + case OP_DIV: + printf("OP_DIV\tR%d\t:%s\t%d\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)]), + GETARG_C(c)); + break; + case OP_LT: + printf("OP_LT\tR%d\t:%s\t%d\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)]), + GETARG_C(c)); + break; + case OP_LE: + printf("OP_LE\tR%d\t:%s\t%d\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)]), + GETARG_C(c)); + break; + case OP_GT: + printf("OP_GT\tR%d\t:%s\t%d\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)]), + GETARG_C(c)); + break; + case OP_GE: + printf("OP_GE\tR%d\t:%s\t%d\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)]), + GETARG_C(c)); + break; + case OP_EQ: + printf("OP_EQ\tR%d\t:%s\t%d\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)]), + GETARG_C(c)); + break; + + case OP_STOP: + printf("OP_STOP\n"); + break; + + case OP_ARRAY: + printf("OP_ARRAY\tR%d\tR%d\t%d\n", GETARG_A(c), GETARG_B(c), GETARG_C(c)); + break; + case OP_ARYCAT: + printf("OP_ARYCAT\tR%d\tR%d\n", GETARG_A(c), GETARG_B(c)); + break; + case OP_ARYPUSH: + printf("OP_ARYPUSH\tR%d\tR%d\n", GETARG_A(c), GETARG_B(c)); + break; + case OP_AREF: + printf("OP_AREF\tR%d\tR%d\t%d\n", GETARG_A(c), GETARG_B(c), GETARG_C(c)); + break; + case OP_APOST: + printf("OP_APOST\tR%d\t%d\t%d\n", GETARG_A(c), GETARG_B(c), GETARG_C(c)); + break; + case OP_STRING: + { + mrb_value s = irep->pool[GETARG_Bx(c)]; + + s = mrb_str_dump(mrb, s); + printf("OP_STRING\tR%d\t%s\n", GETARG_A(c), RSTRING_PTR(s)); + } + break; + case OP_STRCAT: + printf("OP_STRCAT\tR%d\tR%d\n", GETARG_A(c), GETARG_B(c)); + break; + case OP_HASH: + printf("OP_HASH\tR%d\tR%d\t%d\n", GETARG_A(c), GETARG_B(c), GETARG_C(c)); + break; + + case OP_OCLASS: + printf("OP_OCLASS\tR%d\n", GETARG_A(c)); + break; + case OP_CLASS: + printf("OP_CLASS\tR%d\t:%s\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)])); + break; + case OP_MODULE: + printf("OP_MODULE\tR%d\t:%s\n", GETARG_A(c), + mrb_sym2name(mrb, irep->syms[GETARG_B(c)])); + break; + case OP_EXEC: + printf("OP_EXEC\tR%d\tI(%d)\n", GETARG_A(c), n+GETARG_Bx(c)); + break; + case OP_SCLASS: + printf("OP_SCLASS\tR%d\tR%d\n", GETARG_A(c), GETARG_B(c)); + break; + case OP_TCLASS: + printf("OP_TCLASS\tR%d\n", GETARG_A(c)); + break; + case OP_ERR: + printf("OP_ERR\tL(%d)\n", GETARG_Bx(c)); + break; + case OP_EPUSH: + printf("OP_EPUSH\t:I(%d)\n", n+GETARG_Bx(c)); + break; + case OP_ONERR: + printf("OP_ONERR\t%03d\n", i+GETARG_sBx(c)); + break; + case OP_RESCUE: + printf("OP_RESCUE\tR%d\n", GETARG_A(c)); + break; + case OP_RAISE: + printf("OP_RAISE\tR%d\n", GETARG_A(c)); + break; + case OP_POPERR: + printf("OP_POPERR\t%d\n", GETARG_A(c)); + break; + case OP_EPOP: + printf("OP_EPOP\t%d\n", GETARG_A(c)); + break; + + default: + printf("OP_unknown %d\t%d\t%d\t%d\n", GET_OPCODE(c), + GETARG_A(c), GETARG_B(c), GETARG_C(c)); + break; + } + } + printf("\n"); +#endif +} + +void +codedump_all(mrb_state *mrb, int start) +{ + int i; + + for (i=start; i<mrb->irep_len; i++) { + codedump(mrb, i); + } +} + +static int +codegen_start(mrb_state *mrb, parser_state *p) +{ + codegen_scope *scope = scope_new(mrb, 0, 0); + + if (!scope) { + return -1; + } + scope->mrb = mrb; + if (p->filename) { + scope->filename = p->filename; + } + if (setjmp(scope->jmp) != 0) { + return -1; + } + // prepare irep + codegen(scope, p->tree, NOVAL); + mrb_pool_close(scope->mpool); + return 0; +} + +int +mrb_generate_code(mrb_state *mrb, parser_state *p) +{ + int start = mrb->irep_len; + int n; + + n = codegen_start(mrb, p); + if (n < 0) return n; + + return start; +} + +#ifdef CODEGEN_TEST +int +main() +{ + mrb_state *mrb = mrb_open(); + int n; + +#if 1 + n = mrb_compile_string(mrb, "p(__FILE__)\np(__LINE__)"); +#else + n = mrb_compile_string(mrb, "\ +def fib(n)\n\ + if n<2\n\ + n\n\ + else\n\ + fib(n-2)+fib(n-1)\n\ + end\n\ +end\n\ +p(fib(30), \"\\n\")\n\ +"); +#endif + printf("ret: %d\n", n); +#ifdef CODEGEN_DUMP + codedump_all(mrb, n); +#endif + mrb_run(mrb, mrb_proc_new(mrb, mrb->irep[0]), mrb_nil_value()); + mrb_close(mrb); + + return 0; +} +#endif Added: vendor/mruby-b5830ae/src/compar.c (+13 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/compar.c 2013-01-09 13:19:18 +0900 (1614d23) @@ -0,0 +1,13 @@ +/* +** compar.c - Comparable module +** +** See Copyright Notice in mruby.h +*/ + +#include "mruby.h" + +void +mrb_init_comparable(mrb_state *mrb) +{ + mrb_define_module(mrb, "Comparable"); +} Added: vendor/mruby-b5830ae/src/crc.c (+34 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/crc.c 2013-01-09 13:19:18 +0900 (0451c36) @@ -0,0 +1,34 @@ +/* +** crc.c - calculate CRC +** +** See Copyright Notice in mruby.h +*/ + +#include <limits.h> +#include <stdint.h> +// Calculate CRC (CRC-16-CCITT) +// +// 0000_0000_0000_0000_0000_0000_0000_0000 +// ^|------- CRC -------|- work --| +// carry +#define CRC_16_CCITT 0x11021ul //x^16+x^12+x^5+1 +#define CRC_XOR_PATTERN (CRC_16_CCITT << 8) +#define CRC_CARRY_BIT (1 << 24) + +uint16_t +calc_crc_16_ccitt(unsigned char *src, int nbytes) +{ + uint32_t crcwk = 0ul; + int ibyte, ibit; + + for (ibyte = 0; ibyte < nbytes; ibyte++) { + crcwk |= *src++; + for (ibit = 0; ibit < CHAR_BIT; ibit++) { + crcwk <<= 1; + if (crcwk & CRC_CARRY_BIT) { + crcwk ^= CRC_XOR_PATTERN; + } + } + } + return (uint16_t)(crcwk >> 8); +} Added: vendor/mruby-b5830ae/src/dump.c (+736 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/dump.c 2013-01-09 13:19:18 +0900 (c32703a) @@ -0,0 +1,736 @@ +/* +** dump.c - mruby binary dumper (Rite binary format) +** +** See Copyright Notice in mruby.h +*/ + +#include <string.h> +#include "mruby/dump.h" +#include <ctype.h> + +#include "mruby/string.h" +#ifdef ENABLE_REGEXP +#include "re.h" +#endif +#include "mruby/irep.h" + +static const unsigned char def_rite_binary_header[] = + RITE_FILE_IDENFIFIER + RITE_FILE_FORMAT_VER + RITE_VM_VER + RITE_COMPILER_TYPE + RITE_COMPILER_VER + "0000" //Binary data size + "00" //Number of ireps + "00" //Start index + RITE_RESERVED +; + +static const unsigned char def_rite_file_header[] = + RITE_FILE_IDENFIFIER + RITE_FILE_FORMAT_VER + RITE_VM_VER + RITE_COMPILER_TYPE + RITE_COMPILER_VER + "00000000" //Binary data size + "0000" //Number of ireps + "0000" //Start index + RITE_RESERVED + "0000" //CRC +; + +const char bin2hex[] = { + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' +}; + +#define DUMP_SIZE(size, type) ((type == DUMP_TYPE_BIN) ? size : size * RITE_FILE_HEX_SIZE) + +enum { + DUMP_IREP_HEADER = 0, + DUMP_ISEQ_BLOCK, + DUMP_POOL_BLOCK, + DUMP_SYMS_BLOCK, + DUMP_SECTION_NUM, +}; + +uint16_t calc_crc_16_ccitt(unsigned char*,int); +static inline int uint8_dump(uint8_t,char*,int); +static inline int uint16_dump(uint16_t,char*,int); +static inline int uint32_dump(uint32_t,char*,int); +static char* str_dump(char*,char*,uint16_t,int); +static uint16_t str_dump_len(char*,uint16_t, int); +static uint32_t get_irep_header_size(mrb_state*,mrb_irep*,int); +static uint32_t get_iseq_block_size(mrb_state*,mrb_irep*,int); +static uint32_t get_pool_block_size(mrb_state*,mrb_irep*,int); +static uint32_t get_syms_block_size(mrb_state*,mrb_irep*,int); +static uint32_t get_irep_record_size(mrb_state*,int,int); +static int write_irep_header(mrb_state*,mrb_irep*,char*,int); +static int write_iseq_block(mrb_state*,mrb_irep*,char*,int); +static int write_pool_block(mrb_state*,mrb_irep*,char*,int); +static int write_syms_block(mrb_state*,mrb_irep*,char*,int); +static int calc_crc_section(mrb_state*,mrb_irep*,uint16_t*,int); +static int write_rite_header(mrb_state*,int,char*,uint32_t); +static int dump_rite_header(mrb_state*,int,FILE*,uint32_t); +static int write_irep_record(mrb_state*,int,char*,uint32_t*,int); +static int dump_irep_record(mrb_state*,int,FILE*,uint32_t*); +static int mrb_write_irep(mrb_state*,int,char*); + + +static inline int +uint8_dump(uint8_t bin, char *hex, int type) +{ + if (type == DUMP_TYPE_BIN) { + *hex = bin; + } else { + *hex++ = bin2hex[(bin >> 4) & 0x0f]; + *hex = bin2hex[bin & 0x0f]; + } + return DUMP_SIZE(MRB_DUMP_SIZE_OF_CHAR, type); +} + +static inline int +uint16_dump(uint16_t bin, char *hex, int type) +{ + if (type == DUMP_TYPE_BIN) { + return (uint16_to_bin(bin, hex)); + } else { + *hex++ = bin2hex[(bin >> 12)& 0x0f]; + *hex++ = bin2hex[(bin >> 8) & 0x0f]; + *hex++ = bin2hex[(bin >> 4) & 0x0f]; + *hex = bin2hex[bin & 0x0f]; + return DUMP_SIZE(MRB_DUMP_SIZE_OF_SHORT, type); + } +} + +static inline int +uint32_dump(uint32_t bin, char *hex, int type) +{ + if (type == DUMP_TYPE_BIN) { + return (uint32_to_bin(bin, hex)); + } else { + *hex++ = bin2hex[(bin >> 28) & 0x0f]; + *hex++ = bin2hex[(bin >> 24) & 0x0f]; + *hex++ = bin2hex[(bin >> 20) & 0x0f]; + *hex++ = bin2hex[(bin >> 16) & 0x0f]; + *hex++ = bin2hex[(bin >> 12) & 0x0f]; + *hex++ = bin2hex[(bin >> 8) & 0x0f]; + *hex++ = bin2hex[(bin >> 4) & 0x0f]; + *hex = bin2hex[bin & 0x0f]; + return DUMP_SIZE(MRB_DUMP_SIZE_OF_LONG, type); + } +} + +#define CHAR_ESC_LEN 13 /* sizeof(\x{ hex of 32bit unsigned int } \0) */ + +static char* +str_dump(char *str, char *hex, uint16_t len, int type) +{ + if (type == DUMP_TYPE_BIN) + memcpy(hex, str, len); + else { + char *src, *dst, buf[CHAR_ESC_LEN + 1]; + int n; + + for (src = str, dst = hex; len > 0; src++, dst++, len--) { + switch (*src) { + case 0x07:/* BEL */ *dst++ = '\\'; *dst = 'a'; break; + case 0x08:/* BS */ *dst++ = '\\'; *dst = 'b'; break; + case 0x09:/* HT */ *dst++ = '\\'; *dst = 't'; break; + case 0x0A:/* LF */ *dst++ = '\\'; *dst = 'n'; break; + case 0x0B:/* VT */ *dst++ = '\\'; *dst = 'v'; break; + case 0x0C:/* FF */ *dst++ = '\\'; *dst = 'f'; break; + case 0x0D:/* CR */ *dst++ = '\\'; *dst = 'r'; break; + case 0x5C:/* \ */ *dst++ = '\\'; *dst = '\\'; break; + case 0x22:/* " */ /* fall through */ + case 0x27:/* ' */ /* fall through */ + // case 0x3F:/* ? */ /* fall through */ + default: + if (*src >= ' ' && *src <= '~') { + *dst = *src; + } else { + n = sprintf(buf, "\\%03o", *src & 0377); + memcpy(dst, buf, n); + dst += (n-1); + } + break; + } + } + } + + return hex; +} + +static uint16_t +str_dump_len(char *str, uint16_t len, int type) +{ + uint16_t dump_len = 0; + + if (type == DUMP_TYPE_BIN) + dump_len = len; + else { + char *src; + + for (src = str; len > 0; src++, len--) { + switch (*src) { + case 0x07:/* BEL */ /* fall through */ + case 0x08:/* BS */ /* fall through */ + case 0x09:/* HT */ /* fall through */ + case 0x0A:/* LF */ /* fall through */ + case 0x0B:/* VT */ /* fall through */ + case 0x0C:/* FF */ /* fall through */ + case 0x0D:/* CR */ /* fall through */ + case 0x5C:/* \ */ /* fall through */ + dump_len += 2; + break; + + case 0x22:/* " */ /* fall through */ + case 0x27:/* ' */ /* fall through */ + // case 0x3F:/* ? */ /* fall through */ + default: + if (*src >= ' ' && *src <= '~') { + dump_len++; + } else { + // dump_len += sprintf(buf, "\\%03o", *src & 0377); + dump_len += 4; + } + break; + } + } + } + + return dump_len; +} + +static uint32_t +get_irep_header_size(mrb_state *mrb, mrb_irep *irep, int type) +{ + uint32_t size = 0; + + size += 2; + size += DUMP_SIZE(MRB_DUMP_SIZE_OF_SHORT, type) * 4; + + return size; +} + +static uint32_t +get_iseq_block_size(mrb_state *mrb, mrb_irep *irep, int type) +{ + uint32_t size = 0; + + size += MRB_DUMP_SIZE_OF_LONG; /* ilen */ + size += irep->ilen * MRB_DUMP_SIZE_OF_LONG; /* iseq(n) */ + size += MRB_DUMP_SIZE_OF_SHORT; /* crc */ + + return DUMP_SIZE(size, type); +} + +static uint32_t +get_pool_block_size(mrb_state *mrb, mrb_irep *irep, int type) +{ + uint32_t size = 0; + int pool_no; + mrb_value str; + char buf[32]; + + size += MRB_DUMP_SIZE_OF_LONG; /* plen */ + size += irep->plen; /* tt(n) */ + size += irep->plen * MRB_DUMP_SIZE_OF_SHORT; /* len(n) */ + size += MRB_DUMP_SIZE_OF_SHORT; /* crc */ + size = DUMP_SIZE(size, type); + + for (pool_no = 0; pool_no < irep->plen; pool_no++) { + uint16_t nlen =0; + int len; + + switch (mrb_type(irep->pool[pool_no])) { + case MRB_TT_FIXNUM: + len = mrb_int_to_str( buf, mrb_fixnum(irep->pool[pool_no])); + size += (uint32_t)len; + break; + case MRB_TT_FLOAT: + len = mrb_float_to_str( buf, mrb_float(irep->pool[pool_no])); + size += (uint32_t)len; + break; + case MRB_TT_STRING: + str = mrb_string_value( mrb, &irep->pool[pool_no]); + nlen = str_dump_len(RSTRING_PTR(str), RSTRING_LEN(str), type); + size += nlen; + break; +#ifdef ENABLE_REGEXP + case MRB_TT_REGEX: + str = mrb_reg_to_s(mrb, irep->pool[pool_no]); + nlen = str_dump_len(RSTRING_PTR(str), RSTRING_LEN(str), type); + size += nlen; + break; +#endif + default: + break; + } + } + + return size; +} + +static uint32_t +get_syms_block_size(mrb_state *mrb, mrb_irep *irep, int type) +{ + uint32_t size = 0; + int sym_no; + + size += MRB_DUMP_SIZE_OF_LONG; /* slen */ + size += MRB_DUMP_SIZE_OF_SHORT; /* crc */ + size = DUMP_SIZE(size, type); + + for (sym_no = 0; sym_no < irep->slen; sym_no++) { + const char * name; + uint16_t nlen =0; + + size += DUMP_SIZE(MRB_DUMP_SIZE_OF_SHORT, type); /* snl(n) */ + if (irep->syms[sym_no] != 0) { + int len; + + name = mrb_sym2name_len(mrb, irep->syms[sym_no], &len); + nlen = str_dump_len((char*)name, len, type); + size += nlen; /* sn(n) */ + } + } + + return size; +} + +static uint32_t +get_irep_record_size(mrb_state *mrb, int irep_no, int type) +{ + uint32_t size = 0; + mrb_irep *irep = mrb->irep[irep_no]; + + size += DUMP_SIZE(MRB_DUMP_SIZE_OF_LONG, type); /* rlen */ + size += get_irep_header_size(mrb, irep, type); + size += get_iseq_block_size(mrb, irep, type); + size += get_pool_block_size(mrb, irep, type); + size += get_syms_block_size(mrb, irep, type); + + return size; +} + +static int +write_irep_header(mrb_state *mrb, mrb_irep *irep, char *buf, int type) +{ + char *buf_top = buf; + + *buf++ = RITE_IREP_IDENFIFIER; /* record identifier */ + *buf++ = RITE_IREP_TYPE_CLASS; /* class or module */ + buf += uint16_dump((uint16_t)irep->nlocals, buf, type); /* number of local variable */ + buf += uint16_dump((uint16_t)irep->nregs, buf, type); /* number of register variable */ + buf += uint16_dump(DUMP_SIZE(MRB_DUMP_SIZE_OF_SHORT, type)/* crc */, buf, type); /* offset of isec block */ + + return (int)(buf - buf_top); +} + +static int +write_iseq_block(mrb_state *mrb, mrb_irep *irep, char *buf, int type) +{ + char *buf_top = buf; + int iseq_no; + + buf += uint32_dump((uint32_t)irep->ilen, buf, type); /* number of opcode */ + + for (iseq_no = 0; iseq_no < irep->ilen; iseq_no++) { + buf += uint32_dump((uint32_t)irep->iseq[iseq_no], buf, type); /* opcode */ + } + + return (int)(buf - buf_top); +} + +static int +write_pool_block(mrb_state *mrb, mrb_irep *irep, char *buf, int type) +{ + int pool_no; + mrb_value str; + char *buf_top = buf; + char *char_buf; + uint16_t buf_size =0; + uint16_t len =0; + + buf_size = MRB_DUMP_DEFAULT_STR_LEN; + if ((char_buf = (char *)mrb_malloc(mrb, buf_size)) == NULL) + goto error_exit; + + buf += uint32_dump((uint32_t)irep->plen, buf, type); /* number of pool */ + + for (pool_no = 0; pool_no < irep->plen; pool_no++) { + buf += uint8_dump(mrb_type(irep->pool[pool_no]), buf, type); /* data type */ + memset(char_buf, 0, buf_size); + + switch (mrb_type(irep->pool[pool_no])) { + case MRB_TT_FIXNUM: + len = mrb_int_to_str(char_buf, mrb_fixnum(irep->pool[pool_no])); + break; + + case MRB_TT_FLOAT: + len = mrb_float_to_str(char_buf, mrb_float(irep->pool[pool_no])); + break; + + case MRB_TT_STRING: + str = irep->pool[pool_no]; + len = str_dump_len(RSTRING_PTR(str), RSTRING_LEN(str), type); + if (len > buf_size - 1) { + buf_size = len + 1; + if ((char_buf = (char *)mrb_realloc(mrb, char_buf, buf_size)) == NULL) + goto error_exit; + memset(char_buf, 0, buf_size); + } + str_dump(RSTRING_PTR(str), char_buf, RSTRING_LEN(str), type); + break; + +#ifdef ENABLE_REGEXP + case MRB_TT_REGEX: + str = mrb_reg_to_s(mrb, irep->pool[pool_no]); + len = str_dump_len(RSTRING_PTR(str), RSTRING_LEN(str), type); + if ( len > buf_size - 1) { + buf_size = len + 1; + if ((char_buf = mrb_realloc(mrb, char_buf, buf_size)) == NULL) + goto error_exit; + memset(char_buf, 0, buf_size); + } + str_dump(RSTRING_PTR(str), char_buf, RSTRING_LEN(str), type); + break; +#endif + + default: + buf += uint16_dump(0, buf, type); /* data length = 0 */ + continue; + } + + buf += uint16_dump(len, buf, type); /* data length */ + + memcpy(buf, char_buf, len); + buf += len; + } + +error_exit: + if (char_buf) + mrb_free(mrb, char_buf); + return (int)(buf - buf_top); +} + +static int +write_syms_block(mrb_state *mrb, mrb_irep *irep, char *buf, int type) +{ + int sym_no; + char *buf_top = buf; + char *char_buf; + uint16_t buf_size =0; + + buf_size = MRB_DUMP_DEFAULT_STR_LEN; + if ((char_buf = (char *)mrb_malloc(mrb, buf_size)) == NULL) + goto error_exit; + + buf += uint32_dump((uint32_t)irep->slen, buf, type); /* number of symbol */ + + for (sym_no = 0; sym_no < irep->slen; sym_no++) { + const char * name; + uint16_t nlen =0; + + if (irep->syms[sym_no] != 0) { + int len; + + name = mrb_sym2name_len(mrb, irep->syms[sym_no], &len); + nlen = str_dump_len((char*)name, len, type); + if ( nlen > buf_size - 1) { + buf_size = nlen + 1; + if ((char_buf = (char *)mrb_realloc(mrb, char_buf, buf_size)) == NULL) + goto error_exit; + } + memset(char_buf, 0, buf_size); + str_dump((char*)name, char_buf, len, type); + + buf += uint16_dump(nlen, buf, type); /* length of symbol name */ + memcpy(buf, char_buf, nlen); /* symbol name */ + buf += nlen; + } + else { + buf += uint16_dump(MRB_DUMP_NULL_SYM_LEN, buf, type); /* length of symbol name */ + } + } + +error_exit: + if (char_buf) + mrb_free(mrb, char_buf); + return (int)(buf - buf_top); +} + +static int +calc_crc_section(mrb_state *mrb, mrb_irep *irep, uint16_t *crc, int section) +{ + char *buf, *buf_top; + uint32_t buf_size; + int type = DUMP_TYPE_BIN; + + switch (section) { + case DUMP_IREP_HEADER: buf_size = get_irep_header_size(mrb, irep, type); break; + case DUMP_ISEQ_BLOCK: buf_size = get_iseq_block_size(mrb, irep, type); break; + case DUMP_POOL_BLOCK: buf_size = get_pool_block_size(mrb, irep, type); break; + case DUMP_SYMS_BLOCK: buf_size = get_syms_block_size(mrb, irep, type); break; + default: return MRB_DUMP_GENERAL_FAILURE; + } + + if ((buf = (char *)mrb_calloc(mrb, 1, buf_size)) == NULL) + return MRB_DUMP_GENERAL_FAILURE; + + buf_top = buf; + + switch (section) { + case DUMP_IREP_HEADER: buf += write_irep_header(mrb, irep, buf, type); break; + case DUMP_ISEQ_BLOCK: buf += write_iseq_block(mrb, irep, buf, type); break; + case DUMP_POOL_BLOCK: buf += write_pool_block(mrb, irep, buf, type); break; + case DUMP_SYMS_BLOCK: buf += write_syms_block(mrb, irep, buf, type); break; + default: break; + } + + *crc = calc_crc_16_ccitt((unsigned char*)buf_top, (int)(buf - buf_top)); + + mrb_free(mrb, buf_top); + + return MRB_DUMP_OK; +} + +static uint16_t +calc_rite_header_crc(mrb_state *mrb, int top, rite_binary_header *binary_header, uint32_t rbds, int type) +{ + memcpy( binary_header, def_rite_binary_header, sizeof(*binary_header)); + + uint32_dump(rbds, (char*)binary_header->rbds, type); + uint16_dump((uint16_t)mrb->irep_len, (char*)binary_header->nirep, type); + uint16_dump((uint16_t)top, (char*)binary_header->sirep, type); + + return calc_crc_16_ccitt((unsigned char*)binary_header, sizeof(*binary_header)); +} + +static int +write_rite_header(mrb_state *mrb, int top, char* bin, uint32_t rbds) +{ + rite_binary_header *binary_header; + uint16_t crc; + int type = DUMP_TYPE_BIN; + + binary_header = (rite_binary_header*)bin; + crc = calc_rite_header_crc(mrb, top, binary_header, rbds, type); + bin += sizeof(*binary_header); + uint16_dump(crc, bin, type); + + return MRB_DUMP_OK; +} + +static int +calc_rite_file_header(mrb_state *mrb, int top, uint32_t rbds, rite_file_header *file_header) +{ + rite_binary_header *binary_header, b_header; + uint16_t crc; + int type; + + /* calc crc */ + type = DUMP_TYPE_BIN; + binary_header = &b_header; + crc = calc_rite_header_crc(mrb, top, binary_header, rbds, type); + + /* dump rbc header */ + memcpy( file_header, def_rite_file_header, sizeof(*file_header)); + + type = DUMP_TYPE_HEX; + uint32_dump(rbds, (char*)file_header->rbds, type); + uint16_dump((uint16_t)mrb->irep_len, (char*)file_header->nirep, type); + uint16_dump((uint16_t)top, (char*)file_header->sirep, type); + uint16_dump(crc, (char*)file_header->hcrc, type); + + return MRB_DUMP_OK; +} + +static int +dump_rite_header(mrb_state *mrb, int top, FILE* fp, uint32_t rbds) +{ + int rc = MRB_DUMP_OK; + rite_file_header file_header; + + if (fseek(fp, 0, SEEK_SET) != 0) + return MRB_DUMP_GENERAL_FAILURE; + + rc = calc_rite_file_header(mrb, top, rbds, &file_header); + if (rc != MRB_DUMP_OK) + return rc; + + if (fwrite(&file_header, sizeof(file_header), 1, fp) != 1) + return MRB_DUMP_WRITE_FAULT; + + return MRB_DUMP_OK; +} + +static int +write_irep_record(mrb_state *mrb, int irep_no, char* bin, uint32_t *rlen, int type) +{ + uint32_t irep_record_size; + mrb_irep *irep = mrb->irep[irep_no]; + int section; + + if (irep == NULL) + return MRB_DUMP_INVALID_IREP; + + /* buf alloc */ + irep_record_size = get_irep_record_size(mrb, irep_no, type); + if (irep_record_size == 0) + return MRB_DUMP_GENERAL_FAILURE; + + memset( bin, 0, irep_record_size); + + /* rlen */ + *rlen = irep_record_size - DUMP_SIZE(MRB_DUMP_SIZE_OF_LONG, type); + + bin += uint32_dump(*rlen, bin, type); + + for (section = 0; section < DUMP_SECTION_NUM; section++) { + int rc; + uint16_t crc; + + switch (section) { + case DUMP_IREP_HEADER: bin += write_irep_header(mrb, irep, bin, type); break; + case DUMP_ISEQ_BLOCK: bin += write_iseq_block(mrb, irep, bin, type); break; + case DUMP_POOL_BLOCK: bin += write_pool_block(mrb, irep, bin, type); break; + case DUMP_SYMS_BLOCK: bin += write_syms_block(mrb, irep, bin, type); break; + default: break; + } + + if ((rc = calc_crc_section(mrb, irep, &crc, section)) != 0) + return rc; + + bin += uint16_dump(crc, bin, type); /* crc */ + } + + return MRB_DUMP_OK; +} + +static int +dump_irep_record(mrb_state *mrb, int irep_no, FILE* fp, uint32_t *rlen) +{ + int rc = MRB_DUMP_OK; + uint32_t irep_record_size; + char *buf; + mrb_irep *irep = mrb->irep[irep_no]; + + if (irep == NULL) + return MRB_DUMP_INVALID_IREP; + + /* buf alloc */ + irep_record_size = get_irep_record_size(mrb, irep_no, DUMP_TYPE_HEX); + if (irep_record_size == 0) + return MRB_DUMP_GENERAL_FAILURE; + + if ((buf = (char *)mrb_calloc(mrb, 1, irep_record_size)) == NULL) + return MRB_DUMP_GENERAL_FAILURE; + + if ((rc = write_irep_record(mrb, irep_no, buf, rlen, DUMP_TYPE_HEX)) != MRB_DUMP_OK) { + rc = MRB_DUMP_GENERAL_FAILURE; + goto error_exit; + } + + + if (fwrite(buf, irep_record_size, 1, fp) != 1) + rc = MRB_DUMP_WRITE_FAULT; + +error_exit: + mrb_free(mrb, buf); + + return rc; +} + +static int +mrb_write_irep(mrb_state *mrb, int top, char *bin) +{ + int rc; + uint32_t rlen=0; /* size of irep record */ + int irep_no; + char *bin_top; + + if (mrb == NULL || top < 0 || top >= mrb->irep_len || bin == NULL) + return MRB_DUMP_INVALID_ARGUMENT; + + bin_top = bin; + bin += sizeof(rite_binary_header) + MRB_DUMP_SIZE_OF_SHORT/* crc */; + + for (irep_no=top; irep_no<mrb->irep_len; irep_no++) { + if ((rc = write_irep_record(mrb, irep_no, bin, &rlen, DUMP_TYPE_BIN)) != 0) + return rc; + + bin += (rlen + DUMP_SIZE(MRB_DUMP_SIZE_OF_LONG, DUMP_TYPE_BIN)); + } + + bin += uint32_dump(0, bin, DUMP_TYPE_BIN); /* end of file */ + + rc = write_rite_header(mrb, top, bin_top, (bin - bin_top)); //TODO: Remove top(SIREP) + + return rc; +} + +int +mrb_dump_irep(mrb_state *mrb, int top, FILE* fp) +{ + int rc; + uint32_t rbds=0; /* size of Rite Binary Data */ + uint32_t rlen=0; /* size of irep record */ + int irep_no; + + if (mrb == NULL || top < 0 || top >= mrb->irep_len || fp == NULL) + return MRB_DUMP_INVALID_ARGUMENT; + + if (fwrite(&def_rite_file_header, sizeof(rite_file_header), 1, fp) != 1) /* dummy write */ + return MRB_DUMP_WRITE_FAULT; + + for (irep_no=top; irep_no<mrb->irep_len; irep_no++) { + if ((rc = dump_irep_record(mrb, irep_no, fp, &rlen)) != 0) + return rc; + + rbds += rlen; + } + + if (fwrite("00000000"/* end of file */, 8, 1, fp) != 1) + return MRB_DUMP_WRITE_FAULT; + + rc = dump_rite_header(mrb, top, fp, rbds); //TODO: Remove top(SIREP) + + return rc; +} + +int +mrb_bdump_irep(mrb_state *mrb, int n, FILE *f,const char *initname) +{ + int rc; + int irep_no; + char *buf; + int buf_size = 0; + int buf_idx = 0; + + if (mrb == NULL || n < 0 || n >= mrb->irep_len || f == NULL || initname == NULL) + return -1; + + buf_size = sizeof(rite_binary_header) + MRB_DUMP_SIZE_OF_SHORT/* crc */; + for (irep_no=n; irep_no<mrb->irep_len; irep_no++) + buf_size += get_irep_record_size(mrb, irep_no, DUMP_TYPE_BIN); + buf_size += MRB_DUMP_SIZE_OF_LONG; /* end of file */ + + if ((buf = (char *)mrb_malloc(mrb, buf_size)) == NULL) + return MRB_DUMP_GENERAL_FAILURE; + + rc = mrb_write_irep(mrb, n, buf); + + if (rc == MRB_DUMP_OK) { + fprintf(f, "const char %s[] = {", initname); + while (buf_idx < buf_size ) { + if (buf_idx % 16 == 0 ) fputs("\n", f); + fprintf(f, "0x%02x,", (unsigned char)buf[buf_idx++]); + } + fputs("\n};\n", f); + } + + mrb_free(mrb, buf); + + return rc; +} Added: vendor/mruby-b5830ae/src/encoding.h (+345 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/encoding.h 2013-01-09 13:19:18 +0900 (7bc0d9e) @@ -0,0 +1,345 @@ +/* +** encoding.h - Encoding class +** +** See Copyright Notice in mruby.h +*/ + +#ifndef RUBY_ENCODING_H +#define RUBY_ENCODING_H 1 + +#if defined(__cplusplus) +extern "C" { +#endif + +#include <stdarg.h> +#include "oniguruma.h" +#include "mruby/data.h" + +#define FL_USHIFT 12 + +#define FL_USER0 (((int)1)<<(FL_USHIFT+0)) +#define FL_USER1 (((int)1)<<(FL_USHIFT+1)) +#define FL_USER2 (((int)1)<<(FL_USHIFT+2)) +#define FL_USER3 (((int)1)<<(FL_USHIFT+3)) +#define FL_USER4 (((int)1)<<(FL_USHIFT+4)) +#define FL_USER5 (((int)1)<<(FL_USHIFT+5)) +#define FL_USER6 (((int)1)<<(FL_USHIFT+6)) +#define FL_USER7 (((int)1)<<(FL_USHIFT+7)) +#define FL_USER8 (((int)1)<<(FL_USHIFT+8)) +#define FL_USER9 (((int)1)<<(FL_USHIFT+9)) + +#define ENCODING_INLINE_MAX 1023 +/* 1023 = 0x03FF */ +/*#define ENCODING_SHIFT (FL_USHIFT+10)*/ +#define ENCODING_SHIFT (10) +#define ENCODING_MASK (((unsigned int)ENCODING_INLINE_MAX)<<ENCODING_SHIFT) + +#define ENCODING_SET_INLINED(obj,i) do {\ + mrb_obj_ptr(obj)->flags &= ~ENCODING_MASK;\ + mrb_obj_ptr(obj)->flags |= (unsigned int)(i) << ENCODING_SHIFT;\ +} while (0) +#define ENCODING_SET(mrb, obj,i) do {\ + mrb_value mrb_encoding_set_obj = (obj); \ + int encoding_set_enc_index = (i); \ + if (encoding_set_enc_index < ENCODING_INLINE_MAX) \ + ENCODING_SET_INLINED(mrb_encoding_set_obj, encoding_set_enc_index); \ + else \ + mrb_enc_set_index(mrb, mrb_encoding_set_obj, encoding_set_enc_index); \ +} while (0) + +#define ENCODING_GET_INLINED(obj) (unsigned int)((RSTRING(obj)->flags & ENCODING_MASK)>>ENCODING_SHIFT) +#define ENCODING_GET(mrb, obj) \ + (ENCODING_GET_INLINED(obj) != ENCODING_INLINE_MAX ? \ + ENCODING_GET_INLINED(obj) : \ + mrb_enc_get_index(mrb, obj)) + +#define ENCODING_IS_ASCII8BIT(obj) (ENCODING_GET_INLINED(obj) == 0) + +#define ENCODING_MAXNAMELEN 42 + +#define ENC_CODERANGE_MASK ((int)(FL_USER8|FL_USER9)) +#define ENC_CODERANGE_UNKNOWN 0 +#define ENC_CODERANGE_7BIT ((int)FL_USER8) +#define ENC_CODERANGE_VALID ((int)FL_USER9) +#define ENC_CODERANGE_BROKEN ((int)(FL_USER8|FL_USER9)) +#define ENC_CODERANGE(obj) ((int)(RSTRING(obj)->flags & ENC_CODERANGE_MASK)) +#define ENC_CODERANGE_ASCIIONLY(obj) (ENC_CODERANGE(obj) == ENC_CODERANGE_7BIT) +#ifdef INCLUDE_ENCODING +#define ENC_CODERANGE_SET(obj,cr) (RSTRING(obj)->flags = \ + (RSTRING(obj)->flags & ~ENC_CODERANGE_MASK) | (cr)) +#else +#define ENC_CODERANGE_SET(obj,cr) +#endif //INCLUDE_ENCODING +#define ENC_CODERANGE_CLEAR(obj) ENC_CODERANGE_SET(obj,0) + +/* assumed ASCII compatibility */ +#define ENC_CODERANGE_AND(a, b) \ + (a == ENC_CODERANGE_7BIT ? b : \ + a == ENC_CODERANGE_VALID ? (b == ENC_CODERANGE_7BIT ? ENC_CODERANGE_VALID : b) : \ + ENC_CODERANGE_UNKNOWN) + +#define ENCODING_CODERANGE_SET(mrb, obj, encindex, cr) \ + do { \ + mrb_value mrb_encoding_coderange_obj = (obj); \ + ENCODING_SET(mrb, mrb_encoding_coderange_obj, (encindex)); \ + ENC_CODERANGE_SET(mrb_encoding_coderange_obj, (cr)); \ + } while (0) + +typedef OnigEncodingType mrb_encoding; + +/* mrb_encoding * -> name */ +#define mrb_enc_name(enc) (enc)->name +int mrb_enc_get_index(mrb_state *mrb, mrb_value obj); + +int mrb_enc_replicate(mrb_state *, const char *, mrb_encoding *); +int mrb_define_dummy_encoding(mrb_state *mrb, const char *); +#define mrb_enc_to_index(enc) ((enc) ? ENC_TO_ENCINDEX(enc) : 0) +void mrb_enc_set_index(mrb_state *mrb, mrb_value obj, int encindex); +int mrb_enc_find_index(mrb_state *mrb, const char *name); +int mrb_to_encoding_index(mrb_state *mrb, mrb_value); +mrb_encoding* mrb_to_encoding(mrb_state *mrb, mrb_value); +mrb_encoding* mrb_enc_get(mrb_state *, mrb_value); +mrb_encoding* mrb_enc_compatible(mrb_state *, mrb_value, mrb_value); +mrb_encoding* mrb_enc_check(mrb_state *, mrb_value, mrb_value); +mrb_value mrb_enc_associate_index(mrb_state *mrb, mrb_value, int); +#ifdef INCLUDE_ENCODING +mrb_value mrb_enc_associate(mrb_state *mrb, mrb_value, mrb_encoding*); +#else +#define mrb_enc_associate(mrb,value,enc) +#endif //INCLUDE_ENCODING +void mrb_enc_copy(mrb_state *mrb, mrb_value dst, mrb_value src); + +mrb_value mrb_enc_reg_new(const char*, long, mrb_encoding*, int); +//PRINTF_ARGS(mrb_value rb_enc_sprintf(mrb_encoding *, const char*, ...), 2, 3); +mrb_value mrb_enc_vsprintf(mrb_encoding *, const char*, va_list); +long mrb_enc_strlen(const char*, const char*, mrb_encoding*); +char* mrb_enc_nth(mrb_state *, const char*, const char*, long, mrb_encoding*); +mrb_value mrb_obj_encoding(mrb_state *, mrb_value); +mrb_value mrb_enc_str_buf_cat(mrb_state *mrb, mrb_value str, const char *ptr, long len, mrb_encoding *enc); +mrb_value rb_enc_uint_chr(mrb_state *mrb, unsigned int code, mrb_encoding *enc); + +mrb_value mrb_external_str_new_with_enc(mrb_state *mrb, const char *ptr, long len, mrb_encoding *); +mrb_value mrb_str_export_to_enc(mrb_value, mrb_encoding *); + +/* index -> mrb_encoding */ +mrb_encoding* mrb_enc_from_index(mrb_state *mrb, int idx); + +/* name -> mrb_encoding */ +mrb_encoding * mrb_enc_find(mrb_state *mrb, const char *name); + +/* mrb_encoding * -> name */ +#define mrb_enc_name(enc) (enc)->name + +/* mrb_encoding * -> minlen/maxlen */ +#define mrb_enc_mbminlen(enc) (enc)->min_enc_len +#define mrb_enc_mbmaxlen(enc) (enc)->max_enc_len + +/* -> mbclen (no error notification: 0 < ret <= e-p, no exception) */ +int mrb_enc_mbclen(const char *p, const char *e, mrb_encoding *enc); + +/* -> mbclen (only for valid encoding) */ +int mrb_enc_fast_mbclen(const char *p, const char *e, mrb_encoding *enc); + +/* -> chlen, invalid or needmore */ +int mrb_enc_precise_mbclen(const char *p, const char *e, mrb_encoding *enc); +#define MBCLEN_CHARFOUND_P(ret) ONIGENC_MBCLEN_CHARFOUND_P(ret) +#define MBCLEN_CHARFOUND_LEN(ret) ONIGENC_MBCLEN_CHARFOUND_LEN(ret) +#define MBCLEN_INVALID_P(ret) ONIGENC_MBCLEN_INVALID_P(ret) +#define MBCLEN_NEEDMORE_P(ret) ONIGENC_MBCLEN_NEEDMORE_P(ret) +#define MBCLEN_NEEDMORE_LEN(ret) ONIGENC_MBCLEN_NEEDMORE_LEN(ret) + +/* -> 0x00..0x7f, -1 */ +int mrb_enc_ascget(mrb_state *mrb, const char *p, const char *e, int *len, mrb_encoding *enc); + + +/* -> code (and len) or raise exception */ +unsigned int mrb_enc_codepoint_len(mrb_state *mrb, const char *p, const char *e, int *len, mrb_encoding *enc); + +/* prototype for obsolete function */ +unsigned int mrb_enc_codepoint(mrb_state *mrb, const char *p, const char *e, mrb_encoding *enc); +/* overriding macro */ +#define mrb_enc_codepoint(mrb,p,e,enc) mrb_enc_codepoint_len((mrb),(p),(e),0,(enc)) +#define mrb_enc_mbc_to_codepoint(p, e, enc) ONIGENC_MBC_TO_CODE(enc,(UChar*)(p),(UChar*)(e)) + +/* -> codelen>0 or raise exception */ +#ifdef INCLUDE_ENCODING +int mrb_enc_codelen(mrb_state *mrb, int code, mrb_encoding *enc); +#else +#define mrb_enc_codelen(mrb,code,enc) 1 +#endif //INCLUDE_ENCODING + +/* code,ptr,encoding -> write buf */ +#define mrb_enc_mbcput(c,buf,enc) ((*(buf) = (char)(c)),1) + +/* start, ptr, end, encoding -> prev_char */ +#define mrb_enc_prev_char(s,p,e,enc) (char *)onigenc_get_prev_char_head(enc,(UChar*)(s),(UChar*)(p),(UChar*)(e)) +/* start, ptr, end, encoding -> next_char */ +#define mrb_enc_left_char_head(s,p,e,enc) (char *)onigenc_get_left_adjust_char_head(enc,(UChar*)(s),(UChar*)(p),(UChar*)(e)) +#define mrb_enc_right_char_head(s,p,e,enc) (char *)onigenc_get_right_adjust_char_head(enc,(UChar*)(s),(UChar*)(p),(UChar*)(e)) + +/* ptr, ptr, encoding -> newline_or_not */ +#define mrb_enc_is_newline(p,end,enc) ONIGENC_IS_MBC_NEWLINE(enc,(UChar*)(p),(UChar*)(end)) + +#define mrb_enc_isctype(c,t,enc) ONIGENC_IS_CODE_CTYPE(enc,c,t) +#define mrb_enc_isascii(c,enc) ONIGENC_IS_CODE_ASCII(c) +#define mrb_enc_isalpha(c,enc) ONIGENC_IS_CODE_ALPHA(enc,c) +#define mrb_enc_islower(c,enc) ONIGENC_IS_CODE_LOWER(enc,c) +#define mrb_enc_isupper(c,enc) ONIGENC_IS_CODE_UPPER(enc,c) +#define mrb_enc_ispunct(c,enc) ONIGENC_IS_CODE_PUNCT(enc,c) +#define mrb_enc_isalnum(c,enc) ONIGENC_IS_CODE_ALNUM(enc,c) +#define mrb_enc_isprint(c,enc) ONIGENC_IS_CODE_PRINT(enc,c) +#define mrb_enc_isspace(c,enc) ONIGENC_IS_CODE_SPACE(enc,c) +#define mrb_enc_isdigit(c,enc) ONIGENC_IS_CODE_DIGIT(enc,c) + +#define mrb_enc_asciicompat(mrb, enc) (mrb_enc_mbminlen(enc)==1 && !mrb_enc_dummy_p(enc)) + +int mrb_enc_casefold(char *to, const char *p, const char *e, mrb_encoding *enc); +int mrb_enc_toupper(int c, mrb_encoding *enc); +int mrb_enc_tolower(int c, mrb_encoding *enc); +//ID mrb_intern3(const char*, long, mrb_encoding*); +//ID mrb_interned_id_p(const char *, long, mrb_encoding *); +int mrb_enc_symname_p(const char*, mrb_encoding*); +int mrb_enc_symname2_p(const char*, long, mrb_encoding*); +int mrb_enc_str_coderange(mrb_state *mrb, mrb_value); +long mrb_str_coderange_scan_restartable(const char*, const char*, mrb_encoding*, int*); +int mrb_enc_str_asciionly_p(mrb_state *mrb, mrb_value); +#define mrb_enc_str_asciicompat_p(mrb, str) mrb_enc_asciicompat(mrb, mrb_enc_get(mrb, str)) +mrb_value mrb_enc_from_encoding(mrb_state *mrb, mrb_encoding *enc); +int mrb_enc_unicode_p(mrb_encoding *enc); +mrb_encoding *mrb_ascii8bit_encoding(mrb_state *mrb); +mrb_encoding *mrb_utf8_encoding(mrb_state *mrb); +mrb_encoding *mrb_usascii_encoding(mrb_state *mrb); +mrb_encoding *mrb_locale_encoding(mrb_state *mrb); +mrb_encoding *mrb_filesystem_encoding(mrb_state *mrb); +mrb_encoding *mrb_default_external_encoding(mrb_state *mrb); +mrb_encoding *mrb_default_internal_encoding(mrb_state *mrb); +int mrb_ascii8bit_encindex(void); +int mrb_utf8_encindex(void); +int mrb_usascii_encindex(void); +int mrb_locale_encindex(mrb_state *mrb); +int mrb_filesystem_encindex(void); +mrb_value mrb_enc_default_external(mrb_state *mrb); +mrb_value mrb_enc_default_internal(mrb_state *mrb); +void mrb_enc_set_default_external(mrb_state *mrb, mrb_value encoding); +void mrb_enc_set_default_internal(mrb_state *mrb, mrb_value encoding); +mrb_value mrb_locale_charmap(mrb_state *mrb, mrb_value klass); +mrb_value mrb_usascii_str_new_cstr(mrb_state *mrb, const char *ptr); +int mrb_str_buf_cat_escaped_char(mrb_state *mrb, mrb_value result, unsigned int c, int unicode_p); + +#define ENC_DUMMY_FLAG (1<<24) +#define ENC_INDEX_MASK (~(~0U<<24)) + +#define ENC_TO_ENCINDEX(enc) (int)((enc)->ruby_encoding_index & ENC_INDEX_MASK) + +#define ENC_DUMMY_P(enc) ((enc)->ruby_encoding_index & ENC_DUMMY_FLAG) +#define ENC_SET_DUMMY(enc) ((enc)->ruby_encoding_index |= ENC_DUMMY_FLAG) + +static inline int +mrb_enc_dummy_p(mrb_encoding *enc) +{ + return ENC_DUMMY_P(enc) != 0; +} + +/* econv stuff */ + +typedef enum { + econv_invalid_byte_sequence, + econv_undefined_conversion, + econv_destination_buffer_full, + econv_source_buffer_empty, + econv_finished, + econv_after_output, + econv_incomplete_input +} mrb_econv_result_t; + +typedef struct mrb_econv_t mrb_econv_t; + +mrb_value mrb_str_encode(mrb_state *mrb, mrb_value str, mrb_value to, int ecflags, mrb_value ecopts); +int mrb_econv_has_convpath_p(mrb_state *mrb, const char* from_encoding, const char* to_encoding); + +int mrb_econv_prepare_opts(mrb_state *mrb, mrb_value opthash, mrb_value *ecopts); + +mrb_econv_t *mrb_econv_open(mrb_state *mrb, const char *source_encoding, const char *destination_encoding, int ecflags); +mrb_econv_t *mrb_econv_open_opts(mrb_state *mrb, const char *source_encoding, const char *destination_encoding, int ecflags, mrb_value ecopts); + +mrb_econv_result_t mrb_econv_convert(mrb_state *mrb, mrb_econv_t *ec, + const unsigned char **source_buffer_ptr, const unsigned char *source_buffer_end, + unsigned char **destination_buffer_ptr, unsigned char *destination_buffer_end, + int flags); +void mrb_econv_close(mrb_econv_t *ec); + +/* result: 0:success -1:failure */ +int mrb_econv_set_replacement(mrb_state *mrb, mrb_econv_t *ec, const unsigned char *str, size_t len, const char *encname); + +/* result: 0:success -1:failure */ +int mrb_econv_decorate_at_first(mrb_state *mrb, mrb_econv_t *ec, const char *decorator_name); +int mrb_econv_decorate_at_last(mrb_state *mrb, mrb_econv_t *ec, const char *decorator_name); + +mrb_value mrb_econv_open_exc(mrb_state *mrb, const char *senc, const char *denc, int ecflags); + +/* result: 0:success -1:failure */ +int mrb_econv_insert_output(mrb_state *mrb, mrb_econv_t *ec, + const unsigned char *str, size_t len, const char *str_encoding); + +/* encoding that mrb_econv_insert_output doesn't need conversion */ +const char *mrb_econv_encoding_to_insert_output(mrb_econv_t *ec); + +/* raise an error if the last mrb_econv_convert is error */ +void mrb_econv_check_error(mrb_state *mrb, mrb_econv_t *ec); + +/* returns an exception object or nil */ +mrb_value mrb_econv_make_exception(mrb_state *mrb, mrb_econv_t *ec); + +int mrb_econv_putbackable(mrb_econv_t *ec); +void mrb_econv_putback(mrb_econv_t *ec, unsigned char *p, int n); + +/* returns the corresponding ASCII compatible encoding for encname, + * or NULL if encname is not ASCII incompatible encoding. */ +const char *mrb_econv_asciicompat_encoding(const char *encname); + +mrb_value mrb_econv_str_convert(mrb_state *mrb, mrb_econv_t *ec, mrb_value src, int flags); +mrb_value mrb_econv_substr_convert(mrb_state *mrb, mrb_econv_t *ec, mrb_value src, long byteoff, long bytesize, int flags); +mrb_value mrb_econv_str_append(mrb_state *mrb, mrb_econv_t *ec, mrb_value src, mrb_value dst, int flags); +mrb_value mrb_econv_substr_append(mrb_state *mrb, mrb_econv_t *ec, mrb_value src, long byteoff, long bytesize, mrb_value dst, int flags); + +void mrb_econv_binmode(mrb_econv_t *ec); + +/* flags for mrb_econv_open */ + +#define ECONV_ERROR_HANDLER_MASK 0x000000ff + +#define ECONV_INVALID_MASK 0x0000000f +#define ECONV_INVALID_REPLACE 0x00000002 + +#define ECONV_UNDEF_MASK 0x000000f0 +#define ECONV_UNDEF_REPLACE 0x00000020 +#define ECONV_UNDEF_HEX_CHARREF 0x00000030 + +#define ECONV_DECORATOR_MASK 0x0000ff00 + +#define ECONV_UNIVERSAL_NEWLINE_DECORATOR 0x00000100 +#define ECONV_CRLF_NEWLINE_DECORATOR 0x00001000 +#define ECONV_CR_NEWLINE_DECORATOR 0x00002000 +#define ECONV_XML_TEXT_DECORATOR 0x00004000 +#define ECONV_XML_ATTR_CONTENT_DECORATOR 0x00008000 + +#define ECONV_STATEFUL_DECORATOR_MASK 0x00f00000 +#define ECONV_XML_ATTR_QUOTE_DECORATOR 0x00100000 + +/* end of flags for mrb_econv_open */ + +/* flags for mrb_econv_convert */ +#define ECONV_PARTIAL_INPUT 0x00010000 +#define ECONV_AFTER_OUTPUT 0x00020000 +/* end of flags for mrb_econv_convert */ + +int mrb_isspace(int c); + +#define ENCODE_CLASS (mrb_class_obj_get(mrb, "Encoding")) +#define CONVERTER_CLASS (mrb_class_obj_get(mrb, "Converter")) + +#if defined(__cplusplus) +} /* extern "C" { */ +#endif + +#endif /* RUBY_ENCODING_H */ Added: vendor/mruby-b5830ae/src/enum.c (+14 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/enum.c 2013-01-09 13:19:18 +0900 (0a58cc5) @@ -0,0 +1,14 @@ +/* +** enum.c - Enumerable module +** +** See Copyright Notice in mruby.h +*/ + +#include "mruby.h" + +void +mrb_init_enumerable(mrb_state *mrb) +{ + mrb_define_module(mrb, "Enumerable"); +} + Added: vendor/mruby-b5830ae/src/error.c (+426 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/error.c 2013-01-09 13:19:18 +0900 (430728d) @@ -0,0 +1,426 @@ +/* +** error.c - Exception class +** +** See Copyright Notice in mruby.h +*/ + +#include "mruby.h" +#include <stdarg.h> +#include <stdio.h> +#include <setjmp.h> +#include <string.h> +#include "error.h" +#include "mruby/variable.h" +#include "mruby/string.h" +#include "mruby/class.h" +#include "mruby/proc.h" +#include "mruby/irep.h" + +#define warn_printf printf + +mrb_value +mrb_exc_new(mrb_state *mrb, struct RClass *c, const char *ptr, long len) +{ + return mrb_funcall(mrb, mrb_obj_value(c), "new", 1, mrb_str_new(mrb, ptr, len)); +} + +mrb_value +mrb_exc_new3(mrb_state *mrb, struct RClass* c, mrb_value str) +{ + //StringValue(str); + mrb_string_value(mrb, &str); + return mrb_funcall(mrb, mrb_obj_value(c), "new", 1, str); +} + +/* + * call-seq: + * Exception.new(msg = nil) -> exception + * + * Construct a new Exception object, optionally passing in + * a message. + */ + +static mrb_value +exc_initialize(mrb_state *mrb, mrb_value exc) +{ + mrb_value mesg; + + if (mrb_get_args(mrb, "|o", &mesg) == 1) { + mrb_iv_set(mrb, exc, mrb_intern(mrb, "mesg"), mesg); + } + return exc; +} + +/* + * Document-method: exception + * + * call-seq: + * exc.exception(string) -> an_exception or exc + * + * With no argument, or if the argument is the same as the receiver, + * return the receiver. Otherwise, create a new + * exception object of the same class as the receiver, but with a + * message equal to <code>string.to_str</code>. + * + */ + +static mrb_value +exc_exception(mrb_state *mrb, mrb_value self) +{ + mrb_value exc; + mrb_value a; + int argc; + + argc = mrb_get_args(mrb, "|o", &a); + if (argc == 0) return self; + if (mrb_obj_equal(mrb, self, a)) return self; + exc = mrb_obj_clone(mrb, self); + mrb_iv_set(mrb, exc, mrb_intern(mrb, "mesg"), a); + + return exc; +} + +/* + * call-seq: + * exception.to_s -> string + * + * Returns exception's message (or the name of the exception if + * no message is set). + */ + +static mrb_value +exc_to_s(mrb_state *mrb, mrb_value exc) +{ + mrb_value mesg = mrb_attr_get(mrb, exc, mrb_intern(mrb, "mesg")); + + if (mrb_nil_p(mesg)) return mrb_str_new2(mrb, mrb_obj_classname(mrb, exc)); + return mesg; +} + +/* + * call-seq: + * exception.message -> string + * + * Returns the result of invoking <code>exception.to_s</code>. + * Normally this returns the exception's message or name. By + * supplying a to_str method, exceptions are agreeing to + * be used where Strings are expected. + */ + +static mrb_value +exc_message(mrb_state *mrb, mrb_value exc) +{ + return mrb_funcall(mrb, exc, "to_s", 0); +} + +/* + * call-seq: + * exception.inspect -> string + * + * Return this exception's class name an message + */ + +static mrb_value +exc_inspect(mrb_state *mrb, mrb_value exc) +{ + mrb_value str, mesg, file, line; + + mesg = mrb_attr_get(mrb, exc, mrb_intern(mrb, "mesg")); + file = mrb_attr_get(mrb, exc, mrb_intern(mrb, "file")); + line = mrb_attr_get(mrb, exc, mrb_intern(mrb, "line")); + + if (!mrb_nil_p(file) && !mrb_nil_p(line)) { + str = file; + mrb_str_cat2(mrb, str, ":"); + mrb_str_append(mrb, str, line); + mrb_str_cat2(mrb, str, ": "); + if (!mrb_nil_p(mesg) && RSTRING_LEN(mesg) > 0) { + mrb_str_append(mrb, str, mesg); + mrb_str_cat2(mrb, str, " ("); + } + mrb_str_cat2(mrb, str, mrb_obj_classname(mrb, exc)); + if (!mrb_nil_p(mesg) && RSTRING_LEN(mesg) > 0) { + mrb_str_cat2(mrb, str, ")"); + } + } + else { + str = mrb_str_new2(mrb, mrb_obj_classname(mrb, exc)); + if (!mrb_nil_p(mesg) && RSTRING_LEN(mesg) > 0) { + mrb_str_cat2(mrb, str, ": "); + mrb_str_append(mrb, str, mesg); + } else { + mrb_str_cat2(mrb, str, ": "); + mrb_str_cat2(mrb, str, mrb_obj_classname(mrb, exc)); + } + } + return str; +} + + +static mrb_value +exc_equal(mrb_state *mrb, mrb_value exc) +{ + mrb_value obj; + mrb_value mesg; + mrb_sym id_mesg = mrb_intern(mrb, "mesg"); + + mrb_get_args(mrb, "o", &obj); + if (mrb_obj_equal(mrb, exc, obj)) return mrb_true_value(); + + if (mrb_obj_class(mrb, exc) != mrb_obj_class(mrb, obj)) { + if (mrb_respond_to(mrb, obj, mrb_intern(mrb, "message"))) { + mesg = mrb_funcall(mrb, obj, "message", 0); + } + else + return mrb_false_value(); + } + else { + mesg = mrb_attr_get(mrb, obj, id_mesg); + } + + if (!mrb_equal(mrb, mrb_attr_get(mrb, exc, id_mesg), mesg)) + return mrb_false_value(); + return mrb_true_value(); +} + +static void +exc_debug_info(mrb_state *mrb, struct RObject *exc) +{ + mrb_callinfo *ci = mrb->ci; + mrb_code *pc = ci->pc; + + mrb_obj_iv_set(mrb, exc, mrb_intern(mrb, "ciidx"), mrb_fixnum_value(ci - mrb->cibase)); + ci--; + while (ci >= mrb->cibase) { + if (ci->proc && !MRB_PROC_CFUNC_P(ci->proc)) { + mrb_irep *irep = ci->proc->body.irep; + + if (irep->filename && irep->lines && irep->iseq <= pc && pc < irep->iseq + irep->ilen) { + mrb_obj_iv_set(mrb, exc, mrb_intern(mrb, "file"), mrb_str_new_cstr(mrb, irep->filename)); + mrb_obj_iv_set(mrb, exc, mrb_intern(mrb, "line"), mrb_fixnum_value(irep->lines[pc - irep->iseq - 1])); + return; + } + } + pc = ci->pc; + ci--; + } +} + +void +mrb_exc_raise(mrb_state *mrb, mrb_value exc) +{ + mrb->exc = (struct RObject*)mrb_object(exc); + exc_debug_info(mrb, mrb->exc); + if (!mrb->jmp) { + abort(); + } + longjmp(*(jmp_buf*)mrb->jmp, 1); +} + +void +mrb_raise(mrb_state *mrb, struct RClass *c, const char *msg) +{ + mrb_value mesg; + mesg = mrb_str_new2(mrb, msg); + mrb_exc_raise(mrb, mrb_exc_new3(mrb, c, mesg)); +} + +void +mrb_raisef(mrb_state *mrb, struct RClass *c, const char *fmt, ...) +{ + va_list args; + char buf[256]; + int n; + + va_start(args, fmt); + n = vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + if (n < 0) { + n = 0; + } + mrb_exc_raise(mrb, mrb_exc_new(mrb, c, buf, n)); +} + +void +mrb_name_error(mrb_state *mrb, mrb_sym id, const char *fmt, ...) +{ + mrb_value exc, argv[2]; + va_list args; + char buf[256]; + int n; + + va_start(args, fmt); + n = vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + if (n < 0) { + n = 0; + } + argv[0] = mrb_str_new(mrb, buf, n); + argv[1] = mrb_symbol_value(id); /* ignore now */ + exc = mrb_class_new_instance(mrb, 1, argv, E_NAME_ERROR); + mrb_exc_raise(mrb, exc); +} + +mrb_value +mrb_sprintf(mrb_state *mrb, const char *fmt, ...) +{ + va_list args; + char buf[256]; + int n; + + va_start(args, fmt); + n = vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + if (n < 0) { + n = 0; + } + return mrb_str_new(mrb, buf, n); +} + +void +mrb_warn(const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + printf("warning: "); + vprintf(fmt, args); + va_end(args); +} + +void +mrb_bug(const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + printf("bug: "); + vprintf(fmt, args); + va_end(args); + exit(EXIT_FAILURE); +} + +static const char * +mrb_strerrno(int err) +{ +#define defined_error(name, num) if (err == num) return name; +#define undefined_error(name) +//#include "known_errors.inc" +#undef defined_error +#undef undefined_error + return NULL; +} + +void +mrb_bug_errno(const char *mesg, int errno_arg) +{ + if (errno_arg == 0) + mrb_bug("%s: errno == 0 (NOERROR)", mesg); + else { + const char *errno_str = mrb_strerrno(errno_arg); + if (errno_str) + mrb_bug("%s: %s (%s)", mesg, strerror(errno_arg), errno_str); + else + mrb_bug("%s: %s (%d)", mesg, strerror(errno_arg), errno_arg); + } +} + +int +sysexit_status(mrb_state *mrb, mrb_value err) +{ + mrb_value st = mrb_iv_get(mrb, err, mrb_intern(mrb, "status")); + return mrb_fixnum(st); +} + +static void +set_backtrace(mrb_state *mrb, mrb_value info, mrb_value bt) +{ + mrb_funcall(mrb, info, "set_backtrace", 1, bt); +} + +mrb_value +make_exception(mrb_state *mrb, int argc, mrb_value *argv, int isstr) +{ + mrb_value mesg; + int n; + + mesg = mrb_nil_value(); + switch (argc) { + case 0: + break; + case 1: + if (mrb_nil_p(argv[0])) + break; + if (isstr) { + mesg = mrb_check_string_type(mrb, argv[0]); + if (!mrb_nil_p(mesg)) { + mesg = mrb_exc_new3(mrb, E_RUNTIME_ERROR, mesg); + break; + } + } + n = 0; + goto exception_call; + + case 2: + case 3: + n = 1; +exception_call: + { + mrb_sym exc = mrb_intern(mrb, "exception"); + if (mrb_respond_to(mrb, argv[0], exc)) { + mesg = mrb_funcall_argv(mrb, argv[0], exc, n, argv+1); + } + else { + /* undef */ + mrb_raise(mrb, E_TYPE_ERROR, "exception class/object expected"); + } + } + + break; + default: + mrb_raisef(mrb, E_ARGUMENT_ERROR, "wrong number of arguments (%d for 0..3)", argc); + break; + } + if (argc > 0) { + if (!mrb_obj_is_kind_of(mrb, mesg, mrb->eException_class)) + mrb_raise(mrb, E_TYPE_ERROR, "exception object expected"); + if (argc > 2) + set_backtrace(mrb, mesg, argv[2]); + } + + return mesg; +} + +mrb_value +mrb_make_exception(mrb_state *mrb, int argc, mrb_value *argv) +{ + return make_exception(mrb, argc, argv, TRUE); +} + +void +mrb_sys_fail(mrb_state *mrb, const char *mesg) +{ + mrb_raise(mrb, E_RUNTIME_ERROR, mesg); +} + +void +mrb_init_exception(mrb_state *mrb) +{ + struct RClass *e; + + mrb->eException_class = e = mrb_define_class(mrb, "Exception", mrb->object_class); /* 15.2.22 */ + mrb_define_class_method(mrb, e, "exception", mrb_instance_new, ARGS_ANY()); + mrb_define_method(mrb, e, "exception", exc_exception, ARGS_ANY()); + mrb_define_method(mrb, e, "initialize", exc_initialize, ARGS_ANY()); + mrb_define_method(mrb, e, "==", exc_equal, ARGS_REQ(1)); + mrb_define_method(mrb, e, "to_s", exc_to_s, ARGS_NONE()); + mrb_define_method(mrb, e, "message", exc_message, ARGS_NONE()); + mrb_define_method(mrb, e, "inspect", exc_inspect, ARGS_NONE()); + + mrb->eStandardError_class = mrb_define_class(mrb, "StandardError", mrb->eException_class); /* 15.2.23 */ + mrb_define_class(mrb, "RuntimeError", mrb->eStandardError_class); /* 15.2.28 */ + + mrb_define_class(mrb, "RuntimeError", mrb->eStandardError_class); /* 15.2.28 */ + e = mrb_define_class(mrb, "ScriptError", mrb->eException_class); /* 15.2.37 */ + mrb_define_class(mrb, "SyntaxError", e); /* 15.2.38 */ +} Added: vendor/mruby-b5830ae/src/error.h (+24 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/error.h 2013-01-09 13:19:18 +0900 (674d4f4) @@ -0,0 +1,24 @@ +/* +** error.h - Exception class +** +** See Copyright Notice in mruby.h +*/ + +#ifndef MRUBY_ERROR_H +#define MRUBY_ERROR_H + +struct RException { + MRB_OBJECT_HEADER; +}; + +void mrb_sys_fail(mrb_state *mrb, const char *mesg); +void mrb_bug_errno(const char*, int); +int sysexit_status(mrb_state *mrb, mrb_value err); +mrb_value mrb_exc_new3(mrb_state *mrb, struct RClass* c, mrb_value str); +mrb_value make_exception(mrb_state *mrb, int argc, mrb_value *argv, int isstr); +mrb_value mrb_make_exception(mrb_state *mrb, int argc, mrb_value *argv); +mrb_value mrb_sprintf(mrb_state *mrb, const char *fmt, ...); +void mrb_name_error(mrb_state *mrb, mrb_sym id, const char *fmt, ...); +void mrb_exc_print(mrb_state *mrb, struct RObject *exc); + +#endif /* MRUBY_ERROR_H */ Added: vendor/mruby-b5830ae/src/etc.c (+184 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/etc.c 2013-01-09 13:19:18 +0900 (4542c4a) @@ -0,0 +1,184 @@ +/* +** etc.c - +** +** See Copyright Notice in mruby.h +*/ + +#include "mruby.h" +#include "mruby/string.h" +#include "error.h" +#include "mruby/numeric.h" +#include "mruby/data.h" + +struct RData* +mrb_data_object_alloc(mrb_state *mrb, struct RClass *klass, void *ptr, const struct mrb_data_type *type) +{ + struct RData *data; + + data = (struct RData*)mrb_obj_alloc(mrb, MRB_TT_DATA, klass); + data->data = ptr; + data->type = (struct mrb_data_type*) type; + + return data; +} + +void * +mrb_get_datatype(mrb_state *mrb, mrb_value obj, const struct mrb_data_type *type) +{ + if (mrb_special_const_p(obj) || (mrb_type(obj) != MRB_TT_DATA)) { + return NULL; + } + if (DATA_TYPE(obj) != type) { + return NULL; + } + return DATA_PTR(obj); +} + +void * +mrb_check_datatype(mrb_state *mrb, mrb_value obj, const struct mrb_data_type *type) +{ + static const char mesg[] = "wrong argument type %s (expected %s)"; + + if (mrb_special_const_p(obj) || (mrb_type(obj) != MRB_TT_DATA)) { + mrb_check_type(mrb, obj, MRB_TT_DATA); + } + if (DATA_TYPE(obj) != type) { + const char *etype = DATA_TYPE(obj)->struct_name; + mrb_raisef(mrb, E_TYPE_ERROR, mesg, etype, type->struct_name); + } + return DATA_PTR(obj); +} + +mrb_value +mrb_lastline_get(mrb_state *mrb) +{ + mrb_value *argv; + int argc; + + mrb_get_args(mrb, "*", &argv, &argc); + if (argc < 1) { + return mrb_nil_value(); + } + else + { + return argv[0]; + } +} + +/* ------------------------------------------------ */ +/* + * Calls func(obj, arg, recursive), where recursive is non-zero if the + * current method is called recursively on obj + */ + +mrb_value +mrb_exec_recursive(mrb_state *mrb, mrb_value (*func) (mrb_state *, mrb_value, mrb_value, int), mrb_value obj, void *arg) +{ + // return mrb_exec_recursive(mrb, io_puts_ary, line, &out); + return func(mrb, obj, *(mrb_value*)arg, 0); +} + +/* + * Calls func(obj, arg, recursive), where recursive is non-zero if the + * current method is called recursively on the ordered pair <obj, paired_obj> + */ + +mrb_sym +mrb_to_id(mrb_state *mrb, mrb_value name) +{ + mrb_value tmp; + mrb_sym id; + + switch (mrb_type(name)) { + default: + tmp = mrb_check_string_type(mrb, name); + if (mrb_nil_p(tmp)) { + tmp = mrb_inspect(mrb, name); + mrb_raisef(mrb, E_TYPE_ERROR, "%s is not a symbol", + RSTRING_PTR(tmp)); + } + name = tmp; + /* fall through */ + case MRB_TT_STRING: + name = mrb_str_intern(mrb, name); + /* fall through */ + case MRB_TT_SYMBOL: + return mrb_symbol(name); + } + return id; +} + +/* + * call-seq: + * proc { |...| block } -> a_proc + * + * Equivalent to <code>Proc.new</code>. + */ + +mrb_value +mrb_block_proc(void) +{ + return mrb_nil_value();//proc_new(mrb_cProc, FALSE); +} + +static mrb_int +float_id(mrb_float f) +{ + const char *p = (const char*)&f; + int len = sizeof(f); + mrb_int id = 0; + + while (len--) { + id = id*65599 + *p; + p++; + } + id = id + (id>>5); + + return id; +} + +mrb_int +mrb_obj_id(mrb_value obj) +{ + mrb_int tt = mrb_type(obj); + +#define MakeID2(p,t) (((intptr_t)(p))^(t)) +#define MakeID(p) MakeID2(p,tt) + + switch (tt) { + case MRB_TT_FREE: + case MRB_TT_UNDEF: + return MakeID(0); /* not define */ + case MRB_TT_FALSE: + if (mrb_nil_p(obj)) + return MakeID(1); + return MakeID(0); + case MRB_TT_TRUE: + return MakeID(1); + case MRB_TT_SYMBOL: + return MakeID(mrb_symbol(obj)); + case MRB_TT_FIXNUM: + return MakeID2(float_id((mrb_float)mrb_fixnum(obj)), MRB_TT_FLOAT); + case MRB_TT_FLOAT: + return MakeID(float_id(mrb_float(obj))); + case MRB_TT_STRING: + case MRB_TT_OBJECT: + case MRB_TT_CLASS: + case MRB_TT_MODULE: + case MRB_TT_ICLASS: + case MRB_TT_SCLASS: + case MRB_TT_PROC: + case MRB_TT_ARRAY: + case MRB_TT_HASH: + case MRB_TT_RANGE: + case MRB_TT_REGEX: + case MRB_TT_STRUCT: + case MRB_TT_EXCEPTION: + case MRB_TT_MATCH: + case MRB_TT_FILE: + case MRB_TT_DATA: + default: + return MakeID(obj.value.p); + } +} + Added: vendor/mruby-b5830ae/src/ext/.gitkeep (+0 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/ext/.gitkeep 2013-01-09 13:19:18 +0900 (e69de29) Added: vendor/mruby-b5830ae/src/gc.c (+1491 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/gc.c 2013-01-09 13:19:18 +0900 (b3e4b29) @@ -0,0 +1,1491 @@ +/* +** gc.c - garbage collector for mruby +** +** See Copyright Notice in mruby.h +*/ + +#include "mruby.h" +#include "mruby/class.h" +#include "mruby/array.h" +#include "mruby/string.h" +#include "mruby/hash.h" +#include "mruby/range.h" +#include <string.h> +#include "mruby/struct.h" +#include "mruby/proc.h" +#include "mruby/data.h" +#include "mruby/variable.h" + +#ifndef SIZE_MAX +#include <limits.h> // for SIZE_MAX +#endif + +/* + = Tri-color Incremental Garbage Collection + + mruby's GC is Tri-color Incremental GC with Mark & Sweep. + Algorithm details are omitted. + Instead, the part about the implementation described below. + + == Object's Color + + Each object to be painted in three colors. + + * White - Unmarked. + * Gray - Marked, But the child objects are unmarked. + * Black - Marked, the child objects are also marked. + + == Two white part + + The white has a different part of A and B. + In sweep phase, the sweep target white is either A or B. + The sweep target white is switched just before sweep phase. + e.g. A -> B -> A -> B ... + + All objects are painted white when allocated. + This white is another the sweep target white. + For example, if the sweep target white is A, it's B. + So objects when allocated in sweep phase will be next sweep phase target. + Therefore, these objects will not be released accidentally in sweep phase. + + == Execution Timing + + GC Execution Time and Each step interval are decided by live objects count. + List of Adjustment API: + + * gc_interval_ratio_set + * gc_step_ratio_set + + For details, see the comments for each function. + + = Write Barrier + + mruby implementer, C extension library writer must write a write + barrier when writing a pointer to an object on object's field. + Two different write barrier: + + * mrb_field_write_barrier + * mrb_write_barrier + + For details, see the comments for each function. + +*/ + +#ifdef ENABLE_REGEXP +#include "re.h" +#endif + +struct free_obj { + MRB_OBJECT_HEADER; + struct RBasic *next; +}; + +typedef struct { + union { + struct free_obj free; + struct RBasic basic; + struct RObject object; + struct RClass klass; + struct RString string; + struct RArray array; + struct RHash hash; + struct RRange range; +#ifdef ENABLE_STRUCT + struct RStruct structdata; +#endif + struct RProc procdata; +#ifdef ENABLE_REGEXP + struct RMatch match; + struct RRegexp regexp; +#endif + } as; +} RVALUE; + +#ifdef GC_PROFILE +#include <stdio.h> +#include <sys/time.h> + +static double program_invoke_time = 0; +static double gc_time = 0; +static double gc_total_time = 0; + +static double +gettimeofday_time(void) +{ + struct timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec + tv.tv_usec * 1e-6; +} + +#define GC_INVOKE_TIME_REPORT(with) do {\ + fprintf(stderr, "%s\n", with);\ + fprintf(stderr, "gc_invoke: %19.3f\n", gettimeofday_time() - program_invoke_time);\ + fprintf(stderr, "is_generational: %d\n", is_generational(mrb));\ + fprintf(stderr, "is_major_gc: %d\n", is_major_gc(mrb));\ +} while(0) + +#define GC_TIME_START do {\ + gc_time = gettimeofday_time();\ +} while(0) + +#define GC_TIME_STOP_AND_REPORT do {\ + gc_time = gettimeofday_time() - gc_time;\ + gc_total_time += gc_time;\ + fprintf(stderr, "gc_state: %d\n", mrb->gc_state);\ + fprintf(stderr, "live: %d\n", mrb->live);\ + fprintf(stderr, "majorgc_old_threshold: %d\n", mrb->majorgc_old_threshold);\ + fprintf(stderr, "gc_threshold: %d\n", mrb->gc_threshold);\ + fprintf(stderr, "gc_time: %30.20f\n", gc_time);\ + fprintf(stderr, "gc_total_time: %30.20f\n\n", gc_total_time);\ +} while(0) +#else +#define GC_INVOKE_TIME_REPORT(s) +#define GC_TIME_START +#define GC_TIME_STOP_AND_REPORT +#endif + +#ifdef GC_DEBUG +#include <assert.h> +#define gc_assert(expect) assert(expect) +#define DEBUG(x) (x) +#else +#define gc_assert(expect) ((void)0) +#define DEBUG(x) +#endif + +#define GC_STEP_SIZE 1024 + +void* +mrb_realloc(mrb_state *mrb, void *p, size_t len) +{ + void *p2; + + p2 = (mrb->allocf)(mrb, p, len, mrb->ud); + + if (!p2 && len > 0 && mrb->heaps) { + mrb_garbage_collect(mrb); + p2 = (mrb->allocf)(mrb, p, len, mrb->ud); + } + return p2; +} + +void* +mrb_malloc(mrb_state *mrb, size_t len) +{ + return mrb_realloc(mrb, 0, len); +} + +void* +mrb_calloc(mrb_state *mrb, size_t nelem, size_t len) +{ + void *p = NULL; + size_t size; + + if (nelem <= SIZE_MAX / len) { + size = nelem * len; + p = mrb_realloc(mrb, 0, size); + + if (p && size > 0) + memset(p, 0, size); + } + + return p; +} + +void* +mrb_free(mrb_state *mrb, void *p) +{ + return (mrb->allocf)(mrb, p, 0, mrb->ud); +} + +#ifndef MRB_HEAP_PAGE_SIZE +#define MRB_HEAP_PAGE_SIZE 1024 +#endif + +struct heap_page { + struct RBasic *freelist; + struct heap_page *prev; + struct heap_page *next; + struct heap_page *free_next; + struct heap_page *free_prev; + unsigned int old:1; + RVALUE objects[MRB_HEAP_PAGE_SIZE]; +}; + +static void +link_heap_page(mrb_state *mrb, struct heap_page *page) +{ + page->next = mrb->heaps; + if (mrb->heaps) + mrb->heaps->prev = page; + mrb->heaps = page; +} + +static void +unlink_heap_page(mrb_state *mrb, struct heap_page *page) +{ + if (page->prev) + page->prev->next = page->next; + if (page->next) + page->next->prev = page->prev; + if (mrb->heaps == page) + mrb->heaps = page->next; + page->prev = NULL; + page->next = NULL; +} + +static void +link_free_heap_page(mrb_state *mrb, struct heap_page *page) +{ + page->free_next = mrb->free_heaps; + if (mrb->free_heaps) { + mrb->free_heaps->free_prev = page; + } + mrb->free_heaps = page; +} + +static void +unlink_free_heap_page(mrb_state *mrb, struct heap_page *page) +{ + if (page->free_prev) + page->free_prev->free_next = page->free_next; + if (page->free_next) + page->free_next->free_prev = page->free_prev; + if (mrb->free_heaps == page) + mrb->free_heaps = page->free_next; + page->free_prev = NULL; + page->free_next = NULL; +} + +static void +add_heap(mrb_state *mrb) +{ + struct heap_page *page = (struct heap_page *)mrb_calloc(mrb, 1, sizeof(struct heap_page)); + RVALUE *p, *e; + struct RBasic *prev = NULL; + + for (p = page->objects, e=p+MRB_HEAP_PAGE_SIZE; p<e; p++) { + p->as.free.tt = MRB_TT_FREE; + p->as.free.next = prev; + prev = &p->as.basic; + } + page->freelist = prev; + + link_heap_page(mrb, page); + link_free_heap_page(mrb, page); +} + +#define DEFAULT_GC_INTERVAL_RATIO 200 +#define DEFAULT_GC_STEP_RATIO 200 +#define DEFAULT_MAJOR_GC_INC_RATIO 200 +#define is_generational(mrb) (mrb->is_generational_gc_mode) +#define is_major_gc(mrb) (is_generational(mrb) && mrb->gc_full) +#define is_minor_gc(mrb) (is_generational(mrb) && !mrb->gc_full) + +void +mrb_init_heap(mrb_state *mrb) +{ + mrb->heaps = 0; + mrb->free_heaps = 0; + add_heap(mrb); + mrb->gc_interval_ratio = DEFAULT_GC_INTERVAL_RATIO; + mrb->gc_step_ratio = DEFAULT_GC_STEP_RATIO; + mrb->is_generational_gc_mode = TRUE; + mrb->gc_full = TRUE; + +#ifdef GC_PROFILE + program_invoke_time = gettimeofday_time(); +#endif +} + +static void obj_free(mrb_state *mrb, struct RBasic *obj); + +void +mrb_free_heap(mrb_state *mrb) +{ + struct heap_page *page = mrb->heaps; + struct heap_page *tmp; + RVALUE *p, *e; + + while (page) { + tmp = page; + page = page->next; + for (p = tmp->objects, e=p+MRB_HEAP_PAGE_SIZE; p<e; p++) { + if (p->as.free.tt != MRB_TT_FREE) + obj_free(mrb, &p->as.basic); + } + mrb_free(mrb, tmp); + } +} + +static void +gc_protect(mrb_state *mrb, struct RBasic *p) +{ + if (mrb->arena_idx > MRB_ARENA_SIZE) { + /* arena overflow error */ + mrb->arena_idx = MRB_ARENA_SIZE - 4; /* force room in arena */ + mrb_raise(mrb, E_RUNTIME_ERROR, "arena overflow error"); + } + mrb->arena[mrb->arena_idx++] = p; +} + +void +mrb_gc_protect(mrb_state *mrb, mrb_value obj) +{ + if (mrb_special_const_p(obj)) return; + gc_protect(mrb, mrb_basic(obj)); +} + +struct RBasic* +mrb_obj_alloc(mrb_state *mrb, enum mrb_vtype ttype, struct RClass *cls) +{ + struct RBasic *p; + static const RVALUE RVALUE_zero = { { { MRB_TT_FALSE } } }; + +#ifdef MRB_GC_STRESS + mrb_garbage_collect(mrb); +#endif + if (mrb->gc_threshold < mrb->live) { + mrb_incremental_gc(mrb); + } + if (mrb->free_heaps == NULL) { + add_heap(mrb); + } + + p = mrb->free_heaps->freelist; + mrb->free_heaps->freelist = ((struct free_obj*)p)->next; + if (mrb->free_heaps->freelist == NULL) { + unlink_free_heap_page(mrb, mrb->free_heaps); + } + + mrb->live++; + gc_protect(mrb, p); + *(RVALUE *)p = RVALUE_zero; + p->tt = ttype; + p->c = cls; + paint_partial_white(mrb, p); + return p; +} + +static inline void +add_gray_list(mrb_state *mrb, struct RBasic *obj) +{ +#ifdef MRB_GC_STRESS + if (obj->tt > MRB_TT_MAXDEFINE) { + abort(); + } +#endif + paint_gray(obj); + obj->gcnext = mrb->gray_list; + mrb->gray_list = obj; +} + +static void +gc_mark_children(mrb_state *mrb, struct RBasic *obj) +{ + gc_assert(is_gray(obj)); + paint_black(obj); + mrb->gray_list = obj->gcnext; + mrb_gc_mark(mrb, (struct RBasic*)obj->c); + switch (obj->tt) { + case MRB_TT_ICLASS: + mrb_gc_mark(mrb, (struct RBasic*)((struct RClass*)obj)->super); + break; + + case MRB_TT_CLASS: + case MRB_TT_MODULE: + case MRB_TT_SCLASS: + { + struct RClass *c = (struct RClass*)obj; + + mrb_gc_mark_mt(mrb, c); + mrb_gc_mark(mrb, (struct RBasic*)c->super); + } + /* fall through */ + + case MRB_TT_OBJECT: + case MRB_TT_DATA: + mrb_gc_mark_iv(mrb, (struct RObject*)obj); + break; + + case MRB_TT_PROC: + { + struct RProc *p = (struct RProc*)obj; + + mrb_gc_mark(mrb, (struct RBasic*)p->env); + mrb_gc_mark(mrb, (struct RBasic*)p->target_class); + } + break; + + case MRB_TT_ENV: + { + struct REnv *e = (struct REnv*)obj; + + if (e->cioff < 0) { + int i, len; + + len = (int)e->flags; + for (i=0; i<len; i++) { + mrb_gc_mark_value(mrb, e->stack[i]); + } + } + } + break; + + case MRB_TT_ARRAY: + { + struct RArray *a = (struct RArray*)obj; + size_t i, e; + + for (i=0,e=a->len; i<e; i++) { + mrb_gc_mark_value(mrb, a->ptr[i]); + } + } + break; + + case MRB_TT_HASH: + mrb_gc_mark_iv(mrb, (struct RObject*)obj); + mrb_gc_mark_ht(mrb, (struct RHash*)obj); + break; + + case MRB_TT_STRING: + break; + + case MRB_TT_RANGE: + { + struct RRange *r = (struct RRange*)obj; + + mrb_gc_mark_value(mrb, r->edges->beg); + mrb_gc_mark_value(mrb, r->edges->end); + } + break; + +#ifdef ENABLE_REGEXP + case MRB_TT_MATCH: + { + struct RMatch *m = (struct RMatch*)obj; + + mrb_gc_mark(mrb, (struct RBasic*)m->str); + mrb_gc_mark(mrb, (struct RBasic*)m->regexp); + } + break; + case MRB_TT_REGEX: + { + struct RRegexp *r = (struct RRegexp*)obj; + + mrb_gc_mark(mrb, (struct RBasic*)r->src); + } + break; +#endif + +#ifdef ENABLE_STRUCT + case MRB_TT_STRUCT: + { + struct RStruct *s = (struct RStruct*)obj; + long i; + for (i=0; i<s->len; i++){ + mrb_gc_mark_value(mrb, s->ptr[i]); + } + } + break; +#endif + + default: + break; + } +} + +void +mrb_gc_mark(mrb_state *mrb, struct RBasic *obj) +{ + if (obj == 0) return; + if (!is_white(obj)) return; + gc_assert((obj)->tt != MRB_TT_FREE); + add_gray_list(mrb, obj); +} + +static void +obj_free(mrb_state *mrb, struct RBasic *obj) +{ + DEBUG(printf("obj_free(%p,tt=%d)\n",obj,obj->tt)); + switch (obj->tt) { + /* immediate - no mark */ + case MRB_TT_TRUE: + case MRB_TT_FIXNUM: + case MRB_TT_SYMBOL: + case MRB_TT_FLOAT: + /* cannot happen */ + return; + + case MRB_TT_OBJECT: + mrb_gc_free_iv(mrb, (struct RObject*)obj); + break; + + case MRB_TT_CLASS: + case MRB_TT_MODULE: + case MRB_TT_SCLASS: + mrb_gc_free_mt(mrb, (struct RClass*)obj); + mrb_gc_free_iv(mrb, (struct RObject*)obj); + break; + + case MRB_TT_ENV: + { + struct REnv *e = (struct REnv*)obj; + + if (e->cioff < 0) { + mrb_free(mrb, e->stack); + e->stack = 0; + } + } + break; + + case MRB_TT_ARRAY: + if (obj->flags & MRB_ARY_SHARED) + mrb_ary_decref(mrb, ((struct RArray*)obj)->aux.shared); + else + mrb_free(mrb, ((struct RArray*)obj)->ptr); + break; + + case MRB_TT_HASH: + mrb_gc_free_iv(mrb, (struct RObject*)obj); + mrb_gc_free_ht(mrb, (struct RHash*)obj); + break; + + case MRB_TT_STRING: + if (obj->flags & MRB_STR_SHARED) + mrb_str_decref(mrb, ((struct RString*)obj)->aux.shared); + else + mrb_free(mrb, ((struct RString*)obj)->ptr); + break; + + case MRB_TT_RANGE: + mrb_free(mrb, ((struct RRange*)obj)->edges); + break; + +#ifdef ENABLE_STRUCT + case MRB_TT_STRUCT: + mrb_free(mrb, ((struct RStruct*)obj)->ptr); + break; +#endif + + case MRB_TT_DATA: + { + struct RData *d = (struct RData*)obj; + if (d->type->dfree) { + d->type->dfree(mrb, d->data); + } + mrb_gc_free_iv(mrb, (struct RObject*)obj); + } + break; + + default: + break; + } + obj->tt = MRB_TT_FREE; +} + +static void +root_scan_phase(mrb_state *mrb) +{ + int i, j, e; + mrb_callinfo *ci; + + if (!is_minor_gc(mrb)) { + mrb->gray_list = 0; + mrb->variable_gray_list = 0; + } + + mrb_gc_mark_gv(mrb); + /* mark arena */ + for (i=0,e=mrb->arena_idx; i<e; i++) { + mrb_gc_mark(mrb, mrb->arena[i]); + } + /* mark class hierarchy */ + mrb_gc_mark(mrb, (struct RBasic*)mrb->object_class); + /* mark exception */ + mrb_gc_mark(mrb, (struct RBasic*)mrb->exc); + /* mark stack */ + e = mrb->stack - mrb->stbase; + if (mrb->ci) e += mrb->ci->nregs; + if (mrb->stbase + e > mrb->stend) e = mrb->stend - mrb->stbase; + for (i=0; i<e; i++) { + mrb_gc_mark_value(mrb, mrb->stbase[i]); + } + /* mark ensure stack */ + e = (mrb->ci) ? mrb->ci->eidx : 0; + for (i=0; i<e; i++) { + mrb_gc_mark(mrb, (struct RBasic*)mrb->ensure[i]); + } + /* mark closure */ + for (ci = mrb->cibase; ci <= mrb->ci; ci++) { + if (!ci) continue; + mrb_gc_mark(mrb, (struct RBasic*)ci->env); + mrb_gc_mark(mrb, (struct RBasic*)ci->proc); + mrb_gc_mark(mrb, (struct RBasic*)ci->target_class); + } + /* mark irep pool */ + if (mrb->irep) { + size_t len = mrb->irep_len; + if (len > mrb->irep_capa) len = mrb->irep_capa; + for (i=0; i<len; i++) { + mrb_irep *irep = mrb->irep[i]; + if (!irep) continue; + for (j=0; j<irep->plen; j++) { + mrb_gc_mark_value(mrb, irep->pool[j]); + } + } + } +} + +static size_t +gc_gray_mark(mrb_state *mrb, struct RBasic *obj) +{ + size_t children = 0; + + gc_mark_children(mrb, obj); + + switch (obj->tt) { + case MRB_TT_ICLASS: + children++; + break; + + case MRB_TT_CLASS: + case MRB_TT_SCLASS: + case MRB_TT_MODULE: + { + struct RClass *c = (struct RClass*)obj; + + children += mrb_gc_mark_iv_size(mrb, (struct RObject*)obj); + children += mrb_gc_mark_mt_size(mrb, c); + children++; + } + break; + + case MRB_TT_OBJECT: + case MRB_TT_DATA: + children += mrb_gc_mark_iv_size(mrb, (struct RObject*)obj); + break; + + case MRB_TT_ENV: + children += (int)obj->flags; + break; + + case MRB_TT_ARRAY: + { + struct RArray *a = (struct RArray*)obj; + children += a->len; + } + break; + + case MRB_TT_HASH: + children += mrb_gc_mark_iv_size(mrb, (struct RObject*)obj); + children += mrb_gc_mark_ht_size(mrb, (struct RHash*)obj); + break; + + case MRB_TT_PROC: + case MRB_TT_RANGE: + children+=2; + break; + +#ifdef ENABLE_REGEXP + case MRB_TT_MATCH: + children+=2; + break; + case MRB_TT_REGEX: + children+=1; + break; +#endif + +#ifdef ENABLE_STRUCT + case MRB_TT_STRUCT: + { + struct RStruct *s = (struct RStruct*)obj; + children += s->len; + } + break; +#endif + + default: + break; + } + return children; +} + +static size_t +incremental_marking_phase(mrb_state *mrb, size_t limit) +{ + size_t tried_marks = 0; + + while (mrb->gray_list && tried_marks < limit) { + tried_marks += gc_gray_mark(mrb, mrb->gray_list); + } + + return tried_marks; +} + +static void +final_marking_phase(mrb_state *mrb) +{ + while (mrb->gray_list) { + if (is_gray(mrb->gray_list)) + gc_mark_children(mrb, mrb->gray_list); + else + mrb->gray_list = mrb->gray_list->gcnext; + } + gc_assert(mrb->gray_list == NULL); + mrb->gray_list = mrb->variable_gray_list; + mrb->variable_gray_list = 0; + while (mrb->gray_list) { + if (is_gray(mrb->gray_list)) + gc_mark_children(mrb, mrb->gray_list); + else + mrb->gray_list = mrb->gray_list->gcnext; + } + gc_assert(mrb->gray_list == NULL); +} + +static void +prepare_incremental_sweep(mrb_state *mrb) +{ + mrb->gc_state = GC_STATE_SWEEP; + mrb->sweeps = mrb->heaps; + mrb->gc_live_after_mark = mrb->live; +} + +static size_t +incremental_sweep_phase(mrb_state *mrb, size_t limit) +{ + struct heap_page *page = mrb->sweeps; + size_t tried_sweep = 0; + + while (page && (tried_sweep < limit)) { + RVALUE *p = page->objects; + RVALUE *e = p + MRB_HEAP_PAGE_SIZE; + size_t freed = 0; + int dead_slot = 1; + int full = (page->freelist == NULL); + + if (is_minor_gc(mrb) && page->old) { + /* skip a slot which doesn't contain any young object */ + p = e; + dead_slot = 0; + } + while (p<e) { + if (is_dead(mrb, &p->as.basic)) { + if (p->as.basic.tt != MRB_TT_FREE) { + obj_free(mrb, &p->as.basic); + p->as.free.next = page->freelist; + page->freelist = (struct RBasic*)p; + freed++; + } + } + else { + if (!is_minor_gc(mrb)) + paint_partial_white(mrb, &p->as.basic); /* next gc target */ + dead_slot = 0; + } + p++; + } + + /* free dead slot */ + if (dead_slot && freed < MRB_HEAP_PAGE_SIZE) { + struct heap_page *next = page->next; + + unlink_heap_page(mrb, page); + unlink_free_heap_page(mrb, page); + mrb_free(mrb, page); + page = next; + } + else { + if (full && freed > 0) { + link_free_heap_page(mrb, page); + } + if (page->freelist == NULL && is_minor_gc(mrb)) + page->old = TRUE; + else + page->old = FALSE; + page = page->next; + } + tried_sweep += MRB_HEAP_PAGE_SIZE; + mrb->live -= freed; + mrb->gc_live_after_mark -= freed; + } + mrb->sweeps = page; + return tried_sweep; +} + +static size_t +incremental_gc(mrb_state *mrb, size_t limit) +{ + switch (mrb->gc_state) { + case GC_STATE_NONE: + root_scan_phase(mrb); + mrb->gc_state = GC_STATE_MARK; + flip_white_part(mrb); + return 0; + case GC_STATE_MARK: + if (mrb->gray_list) { + return incremental_marking_phase(mrb, limit); + } + else { + final_marking_phase(mrb); + prepare_incremental_sweep(mrb); + return 0; + } + case GC_STATE_SWEEP: { + size_t tried_sweep = 0; + tried_sweep = incremental_sweep_phase(mrb, limit); + if (tried_sweep == 0) + mrb->gc_state = GC_STATE_NONE; + return tried_sweep; + } + default: + /* unknown state */ + gc_assert(0); + return 0; + } +} + +static void +advance_phase(mrb_state *mrb, enum gc_state to_state) +{ + while (mrb->gc_state != to_state) { + incremental_gc(mrb, ~0); + } +} + +static void +clear_all_old(mrb_state *mrb) +{ + size_t origin_mode = mrb->is_generational_gc_mode; + + gc_assert(is_generational(mrb)); + if (is_major_gc(mrb)) { + advance_phase(mrb, GC_STATE_NONE); + } + else { + mrb->is_generational_gc_mode = FALSE; + prepare_incremental_sweep(mrb); + advance_phase(mrb, GC_STATE_NONE); + } + mrb->variable_gray_list = mrb->gray_list = NULL; + mrb->is_generational_gc_mode = origin_mode; +} + +void +mrb_incremental_gc(mrb_state *mrb) +{ + if (mrb->gc_disabled) return; + + GC_INVOKE_TIME_REPORT("mrb_incremental_gc()"); + GC_TIME_START; + + if (is_minor_gc(mrb)) { + do { + incremental_gc(mrb, ~0); + } while (mrb->gc_state != GC_STATE_NONE); + } + else { + size_t limit = 0, result = 0; + limit = (GC_STEP_SIZE/100) * mrb->gc_step_ratio; + while (result < limit) { + result += incremental_gc(mrb, limit); + if (mrb->gc_state == GC_STATE_NONE) + break; + } + } + + if (mrb->gc_state == GC_STATE_NONE) { + gc_assert(mrb->live >= mrb->gc_live_after_mark); + mrb->gc_threshold = (mrb->gc_live_after_mark/100) * mrb->gc_interval_ratio; + if (mrb->gc_threshold < GC_STEP_SIZE) { + mrb->gc_threshold = GC_STEP_SIZE; + } + if (is_major_gc(mrb)) { + mrb->majorgc_old_threshold = mrb->gc_live_after_mark/100 * DEFAULT_MAJOR_GC_INC_RATIO; + mrb->gc_full = FALSE; + } + else if (is_minor_gc(mrb)) { + if (mrb->live > mrb->majorgc_old_threshold) { + clear_all_old(mrb); + mrb->gc_full = TRUE; + } + } + } + else { + mrb->gc_threshold = mrb->live + GC_STEP_SIZE; + } + + + GC_TIME_STOP_AND_REPORT; +} + +void +mrb_garbage_collect(mrb_state *mrb) +{ + size_t max_limit = ~0; + + if (mrb->gc_disabled) return; + GC_INVOKE_TIME_REPORT("mrb_garbage_collect()"); + GC_TIME_START; + + if (mrb->gc_state == GC_STATE_SWEEP) { + /* finish sweep phase */ + while (mrb->gc_state != GC_STATE_NONE) { + incremental_gc(mrb, max_limit); + } + } + + /* clean all black object as old */ + if (is_generational(mrb)) { + clear_all_old(mrb); + mrb->gc_full = TRUE; + } + + do { + incremental_gc(mrb, max_limit); + } while (mrb->gc_state != GC_STATE_NONE); + + mrb->gc_threshold = (mrb->gc_live_after_mark/100) * mrb->gc_interval_ratio; + + if (is_generational(mrb)) { + mrb->majorgc_old_threshold = mrb->gc_live_after_mark/100 * DEFAULT_MAJOR_GC_INC_RATIO; + mrb->gc_full = FALSE; + } + + GC_TIME_STOP_AND_REPORT; +} + +int +mrb_gc_arena_save(mrb_state *mrb) +{ + return mrb->arena_idx; +} + +void +mrb_gc_arena_restore(mrb_state *mrb, int idx) +{ + mrb->arena_idx = idx; +} + +/* + * Field write barrier + * Paint obj(Black) -> value(White) to obj(Black) -> value(Gray). + */ + +void +mrb_field_write_barrier(mrb_state *mrb, struct RBasic *obj, struct RBasic *value) +{ + if (!is_black(obj)) return; + if (!is_white(value)) return; + + gc_assert(!is_dead(mrb, value) && !is_dead(mrb, obj)); + gc_assert(is_generational(mrb) || mrb->gc_state != GC_STATE_NONE); + + if (is_minor_gc(mrb) || mrb->gc_state == GC_STATE_MARK) { + add_gray_list(mrb, value); + } + else { + gc_assert(mrb->gc_state == GC_STATE_SWEEP); + paint_partial_white(mrb, obj); /* for never write barriers */ + } +} + +/* + * Write barrier + * Paint obj(Black) to obj(Gray). + * + * The object that is painted gray will be traversed atomically in final + * mark phase. So you use this write barrier if it's frequency written spot. + * e.g. Set element on Array. + */ + +void +mrb_write_barrier(mrb_state *mrb, struct RBasic *obj) +{ + if (!is_black(obj)) return; + + gc_assert(!is_dead(mrb, obj)); + gc_assert(is_generational(mrb) || mrb->gc_state != GC_STATE_NONE); + paint_gray(obj); + obj->gcnext = mrb->variable_gray_list; + mrb->variable_gray_list = obj; +} + +/* + * call-seq: + * GC.start -> nil + * + * Initiates full garbage collection. + * + */ + +static mrb_value +gc_start(mrb_state *mrb, mrb_value obj) +{ + mrb_garbage_collect(mrb); + return mrb_nil_value(); +} + +/* + * call-seq: + * GC.enable -> true or false + * + * Enables garbage collection, returning <code>true</code> if garbage + * collection was previously disabled. + * + * GC.disable #=> false + * GC.enable #=> true + * GC.enable #=> false + * + */ + +static mrb_value +gc_enable(mrb_state *mrb, mrb_value obj) +{ + int old = mrb->gc_disabled; + + mrb->gc_disabled = FALSE; + if (old) return mrb_true_value(); + return mrb_false_value(); +} + +/* + * call-seq: + * GC.disable -> true or false + * + * Disables garbage collection, returning <code>true</code> if garbage + * collection was already disabled. + * + * GC.disable #=> false + * GC.disable #=> true + * + */ + +static mrb_value +gc_disable(mrb_state *mrb, mrb_value obj) +{ + int old = mrb->gc_disabled; + + mrb->gc_disabled = TRUE; + if (old) return mrb_true_value(); + return mrb_false_value(); +} + +/* + * call-seq: + * GC.interval_ratio -> fixnum + * + * Returns ratio of GC interval. Default value is 200(%). + * + */ + +static mrb_value +gc_interval_ratio_get(mrb_state *mrb, mrb_value obj) +{ + return mrb_fixnum_value(mrb->gc_interval_ratio); +} + +/* + * call-seq: + * GC.interval_ratio = fixnum -> nil + * + * Updates ratio of GC interval. Default value is 200(%). + * GC start as soon as after end all step of GC if you set 100(%). + * + */ + +static mrb_value +gc_interval_ratio_set(mrb_state *mrb, mrb_value obj) +{ + mrb_int ratio; + + mrb_get_args(mrb, "i", &ratio); + mrb->gc_interval_ratio = ratio; + return mrb_nil_value(); +} + +/* + * call-seq: + * GC.step_ratio -> fixnum + * + * Returns step span ratio of Incremental GC. Default value is 200(%). + * + */ + +static mrb_value +gc_step_ratio_get(mrb_state *mrb, mrb_value obj) +{ + return mrb_fixnum_value(mrb->gc_step_ratio); +} + +/* + * call-seq: + * GC.step_ratio = fixnum -> nil + * + * Updates step span ratio of Incremental GC. Default value is 200(%). + * 1 step of incrementalGC becomes long if a rate is big. + * + */ + +static mrb_value +gc_step_ratio_set(mrb_state *mrb, mrb_value obj) +{ + mrb_int ratio; + + mrb_get_args(mrb, "i", &ratio); + mrb->gc_step_ratio = ratio; + return mrb_nil_value(); +} + +static void +change_gen_gc_mode(mrb_state *mrb, mrb_int enable) +{ + if (is_generational(mrb) && !enable) { + if (is_major_gc(mrb)) { + advance_phase(mrb, GC_STATE_NONE); + } + else { + clear_all_old(mrb); + gc_assert(mrb->gc_state == GC_STATE_NONE); + } + mrb->gc_full = FALSE; + } + else if (!is_generational(mrb) && enable) { + advance_phase(mrb, GC_STATE_NONE); + mrb->majorgc_old_threshold = mrb->gc_live_after_mark/100 * DEFAULT_MAJOR_GC_INC_RATIO; + mrb->gc_full = FALSE; + } + mrb->is_generational_gc_mode = enable; +} + +/* + * call-seq: + * GC.generational_mode -> true or false + * + * Returns generational or normal gc mode. + * + */ + +static mrb_value +gc_generational_mode_get(mrb_state *mrb, mrb_value self) +{ + if (mrb->is_generational_gc_mode) + return mrb_true_value(); + else + return mrb_false_value(); +} + +/* + * call-seq: + * GC.generational_mode = true or false -> true or false + * + * Changes to generational or normal gc mode. + * + */ + +static mrb_value +gc_generational_mode_set(mrb_state *mrb, mrb_value self) +{ + mrb_value enable; + + mrb_get_args(mrb, "o", &enable); + if (mrb->is_generational_gc_mode != mrb_test(enable)) + change_gen_gc_mode(mrb, mrb_test(enable)); + + if (mrb_test(enable)) + return mrb_true_value(); + else + return mrb_false_value(); +} + +#ifdef GC_TEST +#ifdef GC_DEBUG +static mrb_value gc_test(mrb_state *, mrb_value); +#endif +#endif + +void +mrb_init_gc(mrb_state *mrb) +{ + struct RClass *gc; + gc = mrb_define_module(mrb, "GC"); + + mrb_define_class_method(mrb, gc, "start", gc_start, ARGS_NONE()); + mrb_define_class_method(mrb, gc, "enable", gc_enable, ARGS_NONE()); + mrb_define_class_method(mrb, gc, "disable", gc_disable, ARGS_NONE()); + mrb_define_class_method(mrb, gc, "interval_ratio", gc_interval_ratio_get, ARGS_NONE()); + mrb_define_class_method(mrb, gc, "interval_ratio=", gc_interval_ratio_set, ARGS_REQ(1)); + mrb_define_class_method(mrb, gc, "step_ratio", gc_step_ratio_get, ARGS_NONE()); + mrb_define_class_method(mrb, gc, "step_ratio=", gc_step_ratio_set, ARGS_REQ(1)); + mrb_define_class_method(mrb, gc, "generational_mode=", gc_generational_mode_set, ARGS_REQ(1)); + mrb_define_class_method(mrb, gc, "generational_mode", gc_generational_mode_get, ARGS_NONE()); +#ifdef GC_TEST +#ifdef GC_DEBUG + mrb_define_class_method(mrb, gc, "test", gc_test, ARGS_NONE()); +#endif +#endif +} + +#ifdef GC_TEST +#ifdef GC_DEBUG +void +test_mrb_field_write_barrier(void) +{ + mrb_state *mrb = mrb_open(); + struct RBasic *obj, *value; + + puts("test_mrb_field_write_barrier"); + mrb->is_generational_gc_mode = FALSE; + obj = mrb_basic(mrb_ary_new(mrb)); + value = mrb_basic(mrb_str_new_cstr(mrb, "value")); + paint_black(obj); + paint_partial_white(mrb,value); + + + puts(" in GC_STATE_MARK"); + mrb->gc_state = GC_STATE_MARK; + mrb_field_write_barrier(mrb, obj, value); + + gc_assert(is_gray(value)); + + + puts(" in GC_STATE_SWEEP"); + paint_partial_white(mrb,value); + mrb->gc_state = GC_STATE_SWEEP; + mrb_field_write_barrier(mrb, obj, value); + + gc_assert(obj->color & mrb->current_white_part); + gc_assert(value->color & mrb->current_white_part); + + + puts(" fail with black"); + mrb->gc_state = GC_STATE_MARK; + paint_white(obj); + paint_partial_white(mrb,value); + mrb_field_write_barrier(mrb, obj, value); + + gc_assert(obj->color & mrb->current_white_part); + + + puts(" fail with gray"); + mrb->gc_state = GC_STATE_MARK; + paint_black(obj); + paint_gray(value); + mrb_field_write_barrier(mrb, obj, value); + + gc_assert(is_gray(value)); + + + { + puts("test_mrb_field_write_barrier_value"); + obj = mrb_basic(mrb_ary_new(mrb)); + mrb_value value = mrb_str_new_cstr(mrb, "value"); + paint_black(obj); + paint_partial_white(mrb, mrb_basic(value)); + + mrb->gc_state = GC_STATE_MARK; + mrb_field_write_barrier_value(mrb, obj, value); + + gc_assert(is_gray(mrb_basic(value))); + } + + mrb_close(mrb); +} + +void +test_mrb_write_barrier(void) +{ + mrb_state *mrb = mrb_open(); + struct RBasic *obj; + + puts("test_mrb_write_barrier"); + obj = mrb_basic(mrb_ary_new(mrb)); + paint_black(obj); + + puts(" in GC_STATE_MARK"); + mrb->gc_state = GC_STATE_MARK; + mrb_write_barrier(mrb, obj); + + gc_assert(is_gray(obj)); + gc_assert(mrb->variable_gray_list == obj); + + + puts(" fail with gray"); + paint_gray(obj); + mrb_write_barrier(mrb, obj); + + gc_assert(is_gray(obj)); + + mrb_close(mrb); +} + +void +test_add_gray_list(void) +{ + mrb_state *mrb = mrb_open(); + struct RBasic *obj1, *obj2; + + puts("test_add_gray_list"); + change_gen_gc_mode(mrb, FALSE); + gc_assert(mrb->gray_list == NULL); + obj1 = mrb_basic(mrb_str_new_cstr(mrb, "test")); + add_gray_list(mrb, obj1); + gc_assert(mrb->gray_list == obj1); + gc_assert(is_gray(obj1)); + + obj2 = mrb_basic(mrb_str_new_cstr(mrb, "test")); + add_gray_list(mrb, obj2); + gc_assert(mrb->gray_list == obj2); + gc_assert(mrb->gray_list->gcnext == obj1); + gc_assert(is_gray(obj2)); + + mrb_close(mrb); +} + +void +test_gc_gray_mark(void) +{ + mrb_state *mrb = mrb_open(); + mrb_value obj_v, value_v; + struct RBasic *obj; + size_t gray_num = 0; + + puts("test_gc_gray_mark"); + + puts(" in MRB_TT_CLASS"); + obj = (struct RBasic*)mrb->object_class; + paint_gray(obj); + gray_num = gc_gray_mark(mrb, obj); + gc_assert(is_black(obj)); + gc_assert(gray_num > 1); + + puts(" in MRB_TT_ARRAY"); + obj_v = mrb_ary_new(mrb); + value_v = mrb_str_new_cstr(mrb, "test"); + paint_gray(mrb_basic(obj_v)); + paint_partial_white(mrb, mrb_basic(value_v)); + mrb_ary_push(mrb, obj_v, value_v); + gray_num = gc_gray_mark(mrb, mrb_basic(obj_v)); + gc_assert(is_black(mrb_basic(obj_v))); + gc_assert(is_gray(mrb_basic(value_v))); + gc_assert(gray_num == 1); + + mrb_close(mrb); +} + +void +test_incremental_gc(void) +{ + mrb_state *mrb = mrb_open(); + size_t max = ~0, live = 0, total = 0, freed = 0; + RVALUE *free; + struct heap_page *page; + + puts("test_incremental_gc"); + change_gen_gc_mode(mrb, FALSE); + + puts(" in mrb_garbage_collect"); + mrb_garbage_collect(mrb); + + gc_assert(mrb->gc_state == GC_STATE_NONE); + puts(" in GC_STATE_NONE"); + incremental_gc(mrb, max); + gc_assert(mrb->gc_state == GC_STATE_MARK); + puts(" in GC_STATE_MARK"); + advance_phase(mrb, GC_STATE_SWEEP); + gc_assert(mrb->gc_state == GC_STATE_SWEEP); + + puts(" in GC_STATE_SWEEP"); + page = mrb->heaps; + while (page) { + RVALUE *p = page->objects; + RVALUE *e = p + MRB_HEAP_PAGE_SIZE; + while (p<e) { + if (is_black(&p->as.basic)) { + live++; + } + if (is_gray(&p->as.basic) && !is_dead(mrb, &p->as.basic)) { + printf("%p\n", &p->as.basic); + } + p++; + } + page = page->next; + total += MRB_HEAP_PAGE_SIZE; + } + + gc_assert(mrb->gray_list == NULL); + + incremental_gc(mrb, max); + gc_assert(mrb->gc_state == GC_STATE_SWEEP); + + incremental_gc(mrb, max); + gc_assert(mrb->gc_state == GC_STATE_NONE); + + free = (RVALUE*)mrb->heaps->freelist; + while (free) { + freed++; + free = (RVALUE*)free->as.free.next; + } + + gc_assert(mrb->live == live); + gc_assert(mrb->live == total-freed); + + puts("test_incremental_gc(gen)"); + advance_phase(mrb, GC_STATE_SWEEP); + change_gen_gc_mode(mrb, TRUE); + + gc_assert(mrb->gc_full == FALSE); + gc_assert(mrb->gc_state == GC_STATE_NONE); + + puts(" in minor"); + gc_assert(is_minor_gc(mrb)); + gc_assert(mrb->majorgc_old_threshold > 0); + mrb->majorgc_old_threshold = 0; + mrb_incremental_gc(mrb); + gc_assert(mrb->gc_full == TRUE); + gc_assert(mrb->gc_state == GC_STATE_NONE); + + puts(" in major"); + gc_assert(is_major_gc(mrb)); + do { + mrb_incremental_gc(mrb); + } while (mrb->gc_state != GC_STATE_NONE); + gc_assert(mrb->gc_full == FALSE); + + mrb_close(mrb); +} + +void +test_incremental_sweep_phase(void) +{ + mrb_state *mrb = mrb_open(); + + puts("test_incremental_sweep_phase"); + + add_heap(mrb); + mrb->sweeps = mrb->heaps; + + gc_assert(mrb->heaps->next->next == NULL); + gc_assert(mrb->free_heaps->next->next == NULL); + incremental_sweep_phase(mrb, MRB_HEAP_PAGE_SIZE*3); + + gc_assert(mrb->heaps->next == NULL); + gc_assert(mrb->heaps == mrb->free_heaps); + + mrb_close(mrb); +} + +static mrb_value +gc_test(mrb_state *mrb, mrb_value self) +{ + test_mrb_field_write_barrier(); + test_mrb_write_barrier(); + test_add_gray_list(); + test_gc_gray_mark(); + test_incremental_gc(); + test_incremental_sweep_phase(); + return mrb_nil_value(); +} +#endif +#endif Added: vendor/mruby-b5830ae/src/hash.c (+1369 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/hash.c 2013-01-09 13:19:18 +0900 (c7a4192) @@ -0,0 +1,1369 @@ +/* +** hash.c - Hash class +** +** See Copyright Notice in mruby.h +*/ + +#include "mruby.h" +#include "mruby/hash.h" +#include "mruby/khash.h" +#include "mruby/class.h" +#include "mruby/array.h" +#include "mruby/string.h" +#include "mruby/variable.h" + +static inline khint_t +mrb_hash_ht_hash_func(mrb_state *mrb, mrb_value key) +{ + khint_t h = mrb_type(key) << 24; + mrb_value h2; + + h2 = mrb_funcall(mrb, key, "hash", 0, 0); + h ^= h2.value.i; + return h; +} + +static inline khint_t +mrb_hash_ht_hash_equal(mrb_state *mrb, mrb_value a, mrb_value b) +{ + return mrb_eql(mrb, a, b); +} + +KHASH_DECLARE(ht, mrb_value, mrb_value, 1) +KHASH_DEFINE (ht, mrb_value, mrb_value, 1, mrb_hash_ht_hash_func, mrb_hash_ht_hash_equal) + +static void mrb_hash_modify(mrb_state *mrb, mrb_value hash); + +static inline mrb_value +mrb_hash_ht_key(mrb_state *mrb, mrb_value key) +{ + if (mrb_string_p(key)) + return mrb_str_dup(mrb, key); + else + return key; +} + +#define KEY(key) mrb_hash_ht_key(mrb, key) + +void +mrb_gc_mark_ht(mrb_state *mrb, struct RHash *hash) +{ + khiter_t k; + khash_t(ht) *h = hash->ht; + + if (!h) return; + for (k = kh_begin(h); k != kh_end(h); k++) + if (kh_exist(h, k)) { + mrb_gc_mark_value(mrb, kh_key(h, k)); + mrb_gc_mark_value(mrb, kh_value(h, k)); + } +} + +size_t +mrb_gc_mark_ht_size(mrb_state *mrb, struct RHash *hash) +{ + if (!hash->ht) return 0; + return kh_size(hash->ht)*2; +} + +void +mrb_gc_free_ht(mrb_state *mrb, struct RHash *hash) +{ + if (hash->ht) kh_destroy(ht, hash->ht); +} + + +mrb_value +mrb_hash_new_capa(mrb_state *mrb, int capa) +{ + struct RHash *h; + + h = (struct RHash*)mrb_obj_alloc(mrb, MRB_TT_HASH, mrb->hash_class); + h->ht = kh_init(ht, mrb); + if (capa > 0) { + kh_resize(ht, h->ht, capa); + } + h->iv = 0; + return mrb_obj_value(h); +} + +mrb_value +mrb_hash_new(mrb_state *mrb) +{ + return mrb_hash_new_capa(mrb, 0); +} + +mrb_value +mrb_hash_get(mrb_state *mrb, mrb_value hash, mrb_value key) +{ + khash_t(ht) *h = RHASH_TBL(hash); + khiter_t k; + + if (h) { + k = kh_get(ht, h, key); + if (k != kh_end(h)) + return kh_value(h, k); + } + + /* not found */ + if (MRB_RHASH_PROCDEFAULT_P(hash)) { + return mrb_funcall(mrb, RHASH_PROCDEFAULT(hash), "call", 2, hash, key); + } + return RHASH_IFNONE(hash); +} + +mrb_value +mrb_hash_fetch(mrb_state *mrb, mrb_value hash, mrb_value key, mrb_value def) +{ + khash_t(ht) *h = RHASH_TBL(hash); + khiter_t k; + + if (h) { + k = kh_get(ht, h, key); + if (k != kh_end(h)) + return kh_value(h, k); + } + + /* not found */ + return def; +} + +void +mrb_hash_set(mrb_state *mrb, mrb_value hash, mrb_value key, mrb_value val) /* mrb_hash_aset */ +{ + khash_t(ht) *h; + khiter_t k; + + mrb_hash_modify(mrb, hash); + h = RHASH_TBL(hash); + + if (!h) h = RHASH_TBL(hash) = kh_init(ht, mrb); + k = kh_get(ht, h, key); + if (k == kh_end(h)) { + /* expand */ + k = kh_put(ht, h, KEY(key)); + } + + kh_value(h, k) = val; + mrb_write_barrier(mrb, (struct RBasic*)RHASH(hash)); + return; +} + +mrb_value +mrb_hash_freeze(mrb_value hash) +{ + //return mrb_obj_freeze(hash); + return (hash); +} + +mrb_value +mrb_hash_dup(mrb_state *mrb, mrb_value hash) +{ + struct RHash* ret; + khash_t(ht) *h, *ret_h; + khiter_t k, ret_k; + + h = RHASH_TBL(hash); + ret = (struct RHash*)mrb_obj_alloc(mrb, MRB_TT_HASH, mrb->hash_class); + ret->ht = kh_init(ht, mrb); + + if (kh_size(h) > 0) { + ret_h = ret->ht; + + for (k = kh_begin(h); k != kh_end(h); k++) { + if (kh_exist(h,k)) { + ret_k = kh_put(ht, ret_h, KEY(kh_key(h,k))); + kh_val(ret_h, ret_k) = kh_val(h,k); + } + } + } + + return mrb_obj_value(ret); +} + +static void +mrb_hash_modify_check(mrb_state *mrb, mrb_value hash) +{ + //if (OBJ_FROZEN(hash)) mrb_error_frozen("hash"); +} + +khash_t(ht) * +mrb_hash_tbl(mrb_state *mrb, mrb_value hash) +{ + khash_t(ht) *h = RHASH_TBL(hash); + + if (!h) { + RHASH_TBL(hash) = kh_init(ht, mrb); + } + return h; +} + +static void +mrb_hash_modify(mrb_state *mrb, mrb_value hash) +{ + //mrb_hash_modify_check(mrb, hash); + mrb_hash_tbl(mrb, hash); +} + +/* 15.2.13.4.16 */ +/* + * call-seq: + * Hash.new -> new_hash + * Hash.new(obj) -> new_hash + * Hash.new {|hash, key| block } -> new_hash + * + * Returns a new, empty hash. If this hash is subsequently accessed by + * a key that doesn't correspond to a hash entry, the value returned + * depends on the style of <code>new</code> used to create the hash. In + * the first form, the access returns <code>nil</code>. If + * <i>obj</i> is specified, this single object will be used for + * all <em>default values</em>. If a block is specified, it will be + * called with the hash object and the key, and should return the + * default value. It is the block's responsibility to store the value + * in the hash if required. + * + * h = Hash.new("Go Fish") + * h["a"] = 100 + * h["b"] = 200 + * h["a"] #=> 100 + * h["c"] #=> "Go Fish" + * # The following alters the single default object + * h["c"].upcase! #=> "GO FISH" + * h["d"] #=> "GO FISH" + * h.keys #=> ["a", "b"] + * + * # While this creates a new default object each time + * h = Hash.new { |hash, key| hash[key] = "Go Fish: #{key}" } + * h["c"] #=> "Go Fish: c" + * h["c"].upcase! #=> "GO FISH: C" + * h["d"] #=> "Go Fish: d" + * h.keys #=> ["c", "d"] + * + */ + +static mrb_value +mrb_hash_init_core(mrb_state *mrb, mrb_value hash) +{ + mrb_value block, ifnone; + mrb_value *argv; + int argc; + + mrb_get_args(mrb, "o*", &block, &argv, &argc); + mrb_hash_modify(mrb, hash); + if (mrb_nil_p(block)) { + if (argc > 0) { + if (argc != 1) mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments"); + ifnone = argv[0]; + } + else { + ifnone = mrb_nil_value(); + } + } + else { + if (argc > 0) { + mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments"); + } + RHASH(hash)->flags |= MRB_HASH_PROC_DEFAULT; + ifnone = block; + } + mrb_iv_set(mrb, hash, mrb_intern(mrb, "ifnone"), ifnone); + return hash; +} + +/* + * call-seq: + * Hash[ key, value, ... ] -> new_hash + * Hash[ [ [key, value], ... ] ] -> new_hash + * Hash[ object ] -> new_hash + * + * Creates a new hash populated with the given objects. Equivalent to + * the literal <code>{ <i>key</i> => <i>value</i>, ... }</code>. In the first + * form, keys and values occur in pairs, so there must be an even number of arguments. + * The second and third form take a single argument which is either + * an array of key-value pairs or an object convertible to a hash. + * + * Hash["a", 100, "b", 200] #=> {"a"=>100, "b"=>200} + * Hash[ [ ["a", 100], ["b", 200] ] ] #=> {"a"=>100, "b"=>200} + * Hash["a" => 100, "b" => 200] #=> {"a"=>100, "b"=>200} + */ + +static mrb_value +to_hash(mrb_state *mrb, mrb_value hash) +{ + return mrb_convert_type(mrb, hash, MRB_TT_HASH, "Hash", "to_hash"); +} + +/* + * call-seq: + * Hash.try_convert(obj) -> hash or nil + * + * Try to convert <i>obj</i> into a hash, using to_hash method. + * Returns converted hash or nil if <i>obj</i> cannot be converted + * for any reason. + * + * Hash.try_convert({1=>2}) # => {1=>2} + * Hash.try_convert("1=>2") # => nil + */ + +/* 15.2.13.4.2 */ +/* + * call-seq: + * hsh[key] -> value + * + * Element Reference---Retrieves the <i>value</i> object corresponding + * to the <i>key</i> object. If not found, returns the default value (see + * <code>Hash::new</code> for details). + * + * h = { "a" => 100, "b" => 200 } + * h["a"] #=> 100 + * h["c"] #=> nil + * + */ +mrb_value +mrb_hash_aget(mrb_state *mrb, mrb_value self) +{ + mrb_value key; + + mrb_get_args(mrb, "o", &key); + return mrb_hash_get(mrb, self, key); +} + +mrb_value +mrb_hash_lookup(mrb_state *mrb, mrb_value hash, mrb_value key) +{ + return mrb_hash_get(mrb, hash, key); +} + +/* + * call-seq: + * hsh.fetch(key [, default] ) -> obj + * hsh.fetch(key) {| key | block } -> obj + * + * Returns a value from the hash for the given key. If the key can't be + * found, there are several options: With no other arguments, it will + * raise an <code>KeyError</code> exception; if <i>default</i> is + * given, then that will be returned; if the optional code block is + * specified, then that will be run and its result returned. + * + * h = { "a" => 100, "b" => 200 } + * h.fetch("a") #=> 100 + * h.fetch("z", "go fish") #=> "go fish" + * h.fetch("z") { |el| "go fish, #{el}"} #=> "go fish, z" + * + * The following example shows that an exception is raised if the key + * is not found and a default value is not supplied. + * + * h = { "a" => 100, "b" => 200 } + * h.fetch("z") + * + * <em>produces:</em> + * + * prog.rb:2:in `fetch': key not found (KeyError) + * from prog.rb:2 + * + */ + +/* 15.2.13.4.5 */ +/* + * call-seq: + * hsh.default(key=nil) -> obj + * + * Returns the default value, the value that would be returned by + * <i>hsh</i>[<i>key</i>] if <i>key</i> did not exist in <i>hsh</i>. + * See also <code>Hash::new</code> and <code>Hash#default=</code>. + * + * h = Hash.new #=> {} + * h.default #=> nil + * h.default(2) #=> nil + * + * h = Hash.new("cat") #=> {} + * h.default #=> "cat" + * h.default(2) #=> "cat" + * + * h = Hash.new {|h,k| h[k] = k.to_i*10} #=> {} + * h.default #=> nil + * h.default(2) #=> 20 + */ + +static mrb_value +mrb_hash_default(mrb_state *mrb, mrb_value hash) +{ + mrb_value *argv; + int argc; + mrb_value key; + + mrb_get_args(mrb, "*", &argv, &argc); + if (MRB_RHASH_PROCDEFAULT_P(hash)) { + if (argc == 0) return mrb_nil_value(); + key = argv[0]; + return mrb_funcall(mrb, RHASH_PROCDEFAULT(hash), "call", 2, hash, key); + } + else { + return RHASH_IFNONE(hash); + } +} + +/* 15.2.13.4.6 */ +/* + * call-seq: + * hsh.default = obj -> obj + * + * Sets the default value, the value returned for a key that does not + * exist in the hash. It is not possible to set the default to a + * <code>Proc</code> that will be executed on each key lookup. + * + * h = { "a" => 100, "b" => 200 } + * h.default = "Go fish" + * h["a"] #=> 100 + * h["z"] #=> "Go fish" + * # This doesn't do what you might hope... + * h.default = proc do |hash, key| + * hash[key] = key + key + * end + * h[2] #=> #<Proc:0x401b3948 �� -:6> + * h["cat"] #=> #<Proc:0x401b3948 �� -:6> + */ + +static mrb_value +mrb_hash_set_default(mrb_state *mrb, mrb_value hash) +{ + mrb_value ifnone; + + mrb_get_args(mrb, "o", &ifnone); + mrb_hash_modify(mrb, hash); + mrb_iv_set(mrb, hash, mrb_intern(mrb, "ifnone"), ifnone); + RHASH(hash)->flags &= ~(MRB_HASH_PROC_DEFAULT); + + return ifnone; +} + +/* 15.2.13.4.7 */ +/* + * call-seq: + * hsh.default_proc -> anObject + * + * If <code>Hash::new</code> was invoked with a block, return that + * block, otherwise return <code>nil</code>. + * + * h = Hash.new {|h,k| h[k] = k*k } #=> {} + * p = h.default_proc #=> #<Proc:0x401b3d08 �� -:1> + * a = [] #=> [] + * p.call(a, 2) + * a #=> [nil, nil, 4] + */ + + +static mrb_value +mrb_hash_default_proc(mrb_state *mrb, mrb_value hash) +{ + if (MRB_RHASH_PROCDEFAULT_P(hash)) { + return RHASH_PROCDEFAULT(hash); + } + return mrb_nil_value(); +} + +/* + * call-seq: + * hsh.default_proc = proc_obj -> proc_obj + * + * Sets the default proc to be executed on each key lookup. + * + * h.default_proc = proc do |hash, key| + * hash[key] = key + key + * end + * h[2] #=> 4 + * h["cat"] #=> "catcat" + */ + +static mrb_value +mrb_hash_set_default_proc(mrb_state *mrb, mrb_value hash) +{ + mrb_value ifnone; + + mrb_get_args(mrb, "o", &ifnone); + mrb_hash_modify(mrb, hash); + mrb_iv_set(mrb, hash, mrb_intern(mrb, "ifnone"), ifnone); + RHASH(hash)->flags |= MRB_HASH_PROC_DEFAULT; + + return ifnone; +} + +mrb_value +mrb_hash_delete_key(mrb_state *mrb, mrb_value hash, mrb_value key) +{ + khash_t(ht) *h = RHASH_TBL(hash); + khiter_t k; + mrb_value delVal; + + if (h) { + k = kh_get(ht, h, key); + if (k != kh_end(h)) { + delVal = kh_value(h, k); + kh_del(ht, h, k); + return delVal; + } + } + + /* not found */ + return mrb_nil_value(); +} + +/* 15.2.13.4.8 */ +/* + * call-seq: + * hsh.delete(key) -> value + * hsh.delete(key) {| key | block } -> value + * + * Deletes and returns a key-value pair from <i>hsh</i> whose key is + * equal to <i>key</i>. If the key is not found, returns the + * <em>default value</em>. If the optional code block is given and the + * key is not found, pass in the key and return the result of + * <i>block</i>. + * + * h = { "a" => 100, "b" => 200 } + * h.delete("a") #=> 100 + * h.delete("z") #=> nil + * h.delete("z") { |el| "#{el} not found" } #=> "z not found" + * + */ +mrb_value +mrb_hash_delete(mrb_state *mrb, mrb_value self) +{ + mrb_value key; + + mrb_get_args(mrb, "o", &key); + return mrb_hash_delete_key(mrb, self, key); +} +struct shift_var { + mrb_value key; + mrb_value val; +}; + + +/* 15.2.13.4.24 */ +/* + * call-seq: + * hsh.shift -> anArray or obj + * + * Removes a key-value pair from <i>hsh</i> and returns it as the + * two-item array <code>[</code> <i>key, value</i> <code>]</code>, or + * the hash's default value if the hash is empty. + * + * h = { 1 => "a", 2 => "b", 3 => "c" } + * h.shift #=> [1, "a"] + * h #=> {2=>"b", 3=>"c"} + */ + +static mrb_value +mrb_hash_shift(mrb_state *mrb, mrb_value hash) +{ + khash_t(ht) *h = RHASH_TBL(hash); + khiter_t k; + mrb_value delKey, delVal; + + mrb_hash_modify(mrb, hash); + if (h) { + if (kh_size(h) > 0) { + for (k = kh_begin(h); k != kh_end(h); k++) { + if (!kh_exist(h,k)) continue; + + delKey = kh_key(h,k); + mrb_gc_protect(mrb, delKey); + delVal = mrb_hash_delete_key(mrb, hash, delKey); + mrb_gc_protect(mrb, delVal); + + return mrb_assoc_new(mrb, delKey, delVal); + } + } + } + + if (MRB_RHASH_PROCDEFAULT_P(hash)) { + return mrb_funcall(mrb, RHASH_PROCDEFAULT(hash), "call", 2, hash, mrb_nil_value()); + } + else { + return RHASH_IFNONE(hash); + } +} + +/* + * call-seq: + * hsh.delete_if {| key, value | block } -> hsh + * hsh.delete_if -> an_enumerator + * + * Deletes every key-value pair from <i>hsh</i> for which <i>block</i> + * evaluates to <code>true</code>. + * + * If no block is given, an enumerator is returned instead. + * + * h = { "a" => 100, "b" => 200, "c" => 300 } + * h.delete_if {|key, value| key >= "b" } #=> {"a"=>100} + * + */ + +/* + * call-seq: + * hsh.reject! {| key, value | block } -> hsh or nil + * hsh.reject! -> an_enumerator + * + * Equivalent to <code>Hash#delete_if</code>, but returns + * <code>nil</code> if no changes were made. + */ + +/* + * call-seq: + * hsh.reject {| key, value | block } -> a_hash + * + * Same as <code>Hash#delete_if</code>, but works on (and returns) a + * copy of the <i>hsh</i>. Equivalent to + * <code><i>hsh</i>.dup.delete_if</code>. + * + */ + +/* + * call-seq: + * hsh.values_at(key, ...) -> array + * + * Return an array containing the values associated with the given keys. + * Also see <code>Hash.select</code>. + * + * h = { "cat" => "feline", "dog" => "canine", "cow" => "bovine" } + * h.values_at("cow", "cat") #=> ["bovine", "feline"] + */ + +mrb_value +mrb_hash_values_at(mrb_state *mrb, int argc, mrb_value *argv, mrb_value hash) +{ + mrb_value result = mrb_ary_new_capa(mrb, argc); + long i; + + for (i=0; i<argc; i++) { + mrb_ary_push(mrb, result, mrb_hash_get(mrb, hash, argv[i])); + } + return result; +} + +/* + * call-seq: + * hsh.select {|key, value| block} -> a_hash + * hsh.select -> an_enumerator + * + * Returns a new hash consisting of entries for which the block returns true. + * + * If no block is given, an enumerator is returned instead. + * + * h = { "a" => 100, "b" => 200, "c" => 300 } + * h.select {|k,v| k > "a"} #=> {"b" => 200, "c" => 300} + * h.select {|k,v| v < 200} #=> {"a" => 100} + */ + +/* + * call-seq: + * hsh.select! {| key, value | block } -> hsh or nil + * hsh.select! -> an_enumerator + * + * Equivalent to <code>Hash#keep_if</code>, but returns + * <code>nil</code> if no changes were made. + */ + +/* + * call-seq: + * hsh.keep_if {| key, value | block } -> hsh + * hsh.keep_if -> an_enumerator + * + * Deletes every key-value pair from <i>hsh</i> for which <i>block</i> + * evaluates to false. + * + * If no block is given, an enumerator is returned instead. + * + */ + +/* 15.2.13.4.4 */ +/* + * call-seq: + * hsh.clear -> hsh + * + * Removes all key-value pairs from <i>hsh</i>. + * + * h = { "a" => 100, "b" => 200 } #=> {"a"=>100, "b"=>200} + * h.clear #=> {} + * + */ + +static mrb_value +mrb_hash_clear(mrb_state *mrb, mrb_value hash) +{ + khash_t(ht) *h = RHASH_TBL(hash); + + if (h) kh_clear(ht, h); + return hash; +} + +/* 15.2.13.4.3 */ +/* 15.2.13.4.26 */ +/* + * call-seq: + * hsh[key] = value -> value + * hsh.store(key, value) -> value + * + * Element Assignment---Associates the value given by + * <i>value</i> with the key given by <i>key</i>. + * <i>key</i> should not have its value changed while it is in + * use as a key (a <code>String</code> passed as a key will be + * duplicated and frozen). + * + * h = { "a" => 100, "b" => 200 } + * h["a"] = 9 + * h["c"] = 4 + * h #=> {"a"=>9, "b"=>200, "c"=>4} + * + */ +mrb_value +mrb_hash_aset(mrb_state *mrb, mrb_value self) +{ + mrb_value key, val; + + mrb_get_args(mrb, "oo", &key, &val); + mrb_hash_set(mrb, self, key, val); + return val; +} + +/* 15.2.13.4.17 */ +/* 15.2.13.4.23 */ +/* + * call-seq: + * hsh.replace(other_hash) -> hsh + * + * Replaces the contents of <i>hsh</i> with the contents of + * <i>other_hash</i>. + * + * h = { "a" => 100, "b" => 200 } + * h.replace({ "c" => 300, "d" => 400 }) #=> {"c"=>300, "d"=>400} + * + */ + +static mrb_value +mrb_hash_replace(mrb_state *mrb, mrb_value hash) +{ + mrb_value hash2, ifnone; + khash_t(ht) *h2; + khiter_t k; + + mrb_get_args(mrb, "o", &hash2); + mrb_hash_modify_check(mrb, hash); + hash2 = to_hash(mrb, hash2); + if (mrb_obj_equal(mrb, hash, hash2)) return hash; + mrb_hash_clear(mrb, hash); + + h2 = RHASH_TBL(hash2); + if (h2) { + for (k = kh_begin(h2); k != kh_end(h2); k++) { + if (kh_exist(h2, k)) + mrb_hash_set(mrb, hash, kh_key(h2, k), kh_value(h2, k)); + } + } + + if (MRB_RHASH_PROCDEFAULT_P(hash2)) { + RHASH(hash)->flags |= MRB_HASH_PROC_DEFAULT; + ifnone = RHASH_PROCDEFAULT(hash2); + } + else { + ifnone = RHASH_IFNONE(hash2); + } + mrb_iv_set(mrb, hash, mrb_intern(mrb, "ifnone"), ifnone); + + return hash; +} + +/* 15.2.13.4.20 */ +/* 15.2.13.4.25 */ +/* + * call-seq: + * hsh.length -> fixnum + * hsh.size -> fixnum + * + * Returns the number of key-value pairs in the hash. + * + * h = { "d" => 100, "a" => 200, "v" => 300, "e" => 400 } + * h.length #=> 4 + * h.delete("a") #=> 200 + * h.length #=> 3 + */ +static mrb_value +mrb_hash_size_m(mrb_state *mrb, mrb_value self) +{ + khash_t(ht) *h = RHASH_TBL(self); + + if (!h) return mrb_fixnum_value(0); + return mrb_fixnum_value(kh_size(h)); +} + +/* 15.2.13.4.12 */ +/* + * call-seq: + * hsh.empty? -> true or false + * + * Returns <code>true</code> if <i>hsh</i> contains no key-value pairs. + * + * {}.empty? #=> true + * + */ +static mrb_value +mrb_hash_empty_p(mrb_state *mrb, mrb_value self) +{ + khash_t(ht) *h = RHASH_TBL(self); + + if (h) { + if (kh_size(h) == 0) + return mrb_true_value(); + } + return mrb_false_value(); +} + +/* 15.2.13.4.11 */ +/* + * call-seq: + * hsh.each_value {| value | block } -> hsh + * hsh.each_value -> an_enumerator + * + * Calls <i>block</i> once for each key in <i>hsh</i>, passing the + * value as a parameter. + * + * If no block is given, an enumerator is returned instead. + * + * h = { "a" => 100, "b" => 200 } + * h.each_value {|value| puts value } + * + * <em>produces:</em> + * + * 100 + * 200 + */ + +/* 15.2.13.4.10 */ +/* + * call-seq: + * hsh.each_key {| key | block } -> hsh + * hsh.each_key -> an_enumerator + * + * Calls <i>block</i> once for each key in <i>hsh</i>, passing the key + * as a parameter. + * + * If no block is given, an enumerator is returned instead. + * + * h = { "a" => 100, "b" => 200 } + * h.each_key {|key| puts key } + * + * <em>produces:</em> + * + * a + * b + */ + +/* 15.2.13.4.9 */ +/* + * call-seq: + * hsh.each {| key, value | block } -> hsh + * hsh.each_pair {| key, value | block } -> hsh + * hsh.each -> an_enumerator + * hsh.each_pair -> an_enumerator + * + * Calls <i>block</i> once for each key in <i>hsh</i>, passing the key-value + * pair as parameters. + * + * If no block is given, an enumerator is returned instead. + * + * h = { "a" => 100, "b" => 200 } + * h.each {|key, value| puts "#{key} is #{value}" } + * + * <em>produces:</em> + * + * a is 100 + * b is 200 + * + */ + +static mrb_value +inspect_hash(mrb_state *mrb, mrb_value hash, int recur) +{ + mrb_value str, str2; + khash_t(ht) *h = RHASH_TBL(hash); + khiter_t k; + + if (recur) return mrb_str_new(mrb, "{...}", 5); + + str = mrb_str_new(mrb, "{", 1); + if (h && kh_size(h) > 0) { + for (k = kh_begin(h); k != kh_end(h); k++) { + int ai; + + if (!kh_exist(h,k)) continue; + + ai = mrb_gc_arena_save(mrb); + + if (RSTRING_LEN(str) > 1) mrb_str_cat2(mrb, str, ", "); + + str2 = mrb_inspect(mrb, kh_key(h,k)); + mrb_str_append(mrb, str, str2); + mrb_str_buf_cat(mrb, str, "=>", 2); + str2 = mrb_inspect(mrb, kh_value(h,k)); + mrb_str_append(mrb, str, str2); + + mrb_gc_arena_restore(mrb, ai); + } + } + mrb_str_buf_cat(mrb, str, "}", 1); + + return str; +} + +/* 15.2.13.4.30 (x)*/ +/* + * call-seq: + * hsh.to_s -> string + * hsh.inspect -> string + * + * Return the contents of this hash as a string. + * + * h = { "c" => 300, "a" => 100, "d" => 400, "c" => 300 } + * h.to_s #=> "{\"c\"=>300, \"a\"=>100, \"d\"=>400}" + */ + +static mrb_value +mrb_hash_inspect(mrb_state *mrb, mrb_value hash) +{ + khash_t(ht) *h = RHASH_TBL(hash); + + if (!h || kh_size(h) == 0) + return mrb_str_new(mrb, "{}", 2); + return inspect_hash(mrb, hash, 0); +} + +/* 15.2.13.4.29 (x)*/ +/* + * call-seq: + * hsh.to_hash => hsh + * + * Returns +self+. + */ + +static mrb_value +mrb_hash_to_hash(mrb_state *mrb, mrb_value hash) +{ + return hash; +} + +/* 15.2.13.4.19 */ +/* + * call-seq: + * hsh.keys -> array + * + * Returns a new array populated with the keys from this hash. See also + * <code>Hash#values</code>. + * + * h = { "a" => 100, "b" => 200, "c" => 300, "d" => 400 } + * h.keys #=> ["a", "b", "c", "d"] + * + */ + +mrb_value +mrb_hash_keys(mrb_state *mrb, mrb_value hash) +{ + khash_t(ht) *h = RHASH_TBL(hash); + khiter_t k; + mrb_value ary; + + if (!h) return mrb_ary_new(mrb); + ary = mrb_ary_new_capa(mrb, kh_size(h)); + for (k = kh_begin(h); k != kh_end(h); k++) { + if (kh_exist(h, k)) { + mrb_value v = kh_key(h,k); + mrb_ary_push(mrb, ary, v); + } + } + return ary; +} + +/* 15.2.13.4.28 */ +/* + * call-seq: + * hsh.values -> array + * + * Returns a new array populated with the values from <i>hsh</i>. See + * also <code>Hash#keys</code>. + * + * h = { "a" => 100, "b" => 200, "c" => 300 } + * h.values #=> [100, 200, 300] + * + */ + +static mrb_value +mrb_hash_values(mrb_state *mrb, mrb_value hash) +{ + khash_t(ht) *h = RHASH_TBL(hash); + khiter_t k; + mrb_value ary; + + if (!h) return mrb_ary_new(mrb); + ary = mrb_ary_new_capa(mrb, kh_size(h)); + for (k = kh_begin(h); k != kh_end(h); k++) { + if (kh_exist(h, k)){ + mrb_value v = kh_value(h,k); + mrb_ary_push(mrb, ary, v); + } + } + return ary; +} + +static mrb_value +mrb_hash_has_keyWithKey(mrb_state *mrb, mrb_value hash, mrb_value key) +{ + khash_t(ht) *h = RHASH_TBL(hash); + khiter_t k; + + if (h) { + k = kh_get(ht, h, key); + if (k != kh_end(h)) + return mrb_true_value(); + } + + return mrb_false_value(); +} + +/* 15.2.13.4.13 */ +/* 15.2.13.4.15 */ +/* 15.2.13.4.18 */ +/* 15.2.13.4.21 */ +/* + * call-seq: + * hsh.has_key?(key) -> true or false + * hsh.include?(key) -> true or false + * hsh.key?(key) -> true or false + * hsh.member?(key) -> true or false + * + * Returns <code>true</code> if the given key is present in <i>hsh</i>. + * + * h = { "a" => 100, "b" => 200 } + * h.has_key?("a") #=> true + * h.has_key?("z") #=> false + * + */ + +static mrb_value +mrb_hash_has_key(mrb_state *mrb, mrb_value hash) +{ + mrb_value key; + + mrb_get_args(mrb, "o", &key); + return mrb_hash_has_keyWithKey(mrb, hash, key); +} + +static mrb_value +mrb_hash_has_valueWithvalue(mrb_state *mrb, mrb_value hash, mrb_value value) +{ + khash_t(ht) *h = RHASH_TBL(hash); + khiter_t k; + + if (h) { + for (k = kh_begin(h); k != kh_end(h); k++) { + if (!kh_exist(h, k)) continue; + + if (mrb_equal(mrb, kh_value(h,k), value)) { + return mrb_true_value(); + } + } + } + + return mrb_false_value(); +} + +/* 15.2.13.4.14 */ +/* 15.2.13.4.27 */ +/* + * call-seq: + * hsh.has_value?(value) -> true or false + * hsh.value?(value) -> true or false + * + * Returns <code>true</code> if the given value is present for some key + * in <i>hsh</i>. + * + * h = { "a" => 100, "b" => 200 } + * h.has_value?(100) #=> true + * h.has_value?(999) #=> false + */ + +static mrb_value +mrb_hash_has_value(mrb_state *mrb, mrb_value hash) +{ + mrb_value val; + + mrb_get_args(mrb, "o", &val); + return mrb_hash_has_valueWithvalue(mrb, hash, val); +} + +static mrb_value +hash_equal(mrb_state *mrb, mrb_value hash1, mrb_value hash2, int eql) +{ + khash_t(ht) *h1, *h2; + + if (mrb_obj_equal(mrb, hash1, hash2)) return mrb_true_value(); + if (!mrb_hash_p(hash2)) { + if (!mrb_respond_to(mrb, hash2, mrb_intern(mrb, "to_hash"))) { + return mrb_false_value(); + } + if (eql) + return mrb_fixnum_value(mrb_eql(mrb, hash2, hash1)); + else + return mrb_fixnum_value(mrb_equal(mrb, hash2, hash1)); + } + h1 = RHASH_TBL(hash1); + h2 = RHASH_TBL(hash2); + if (!h2) { + if (!h2) return mrb_true_value(); + return mrb_false_value(); + } + if (!h2) return mrb_false_value(); + if (kh_size(h1) != kh_size(h2)) return mrb_false_value(); + else { + khiter_t k1, k2; + mrb_value key; + + for (k1 = kh_begin(h1); k1 != kh_end(h1); k1++) { + if (!kh_exist(h1, k1)) continue; + key = kh_key(h1,k1); + k2 = kh_get(ht, h2, key); + if (k2 != kh_end(h2)) { + if (mrb_equal(mrb, kh_value(h1,k1), kh_value(h2,k2))) { + continue; /* next key */ + } + } + return mrb_false_value(); + } + } + return mrb_true_value(); +} + +/* 15.2.13.4.1 */ +/* + * call-seq: + * hsh == other_hash -> true or false + * + * Equality---Two hashes are equal if they each contain the same number + * of keys and if each key-value pair is equal to (according to + * <code>Object#==</code>) the corresponding elements in the other + * hash. + * + * h1 = { "a" => 1, "c" => 2 } + * h2 = { 7 => 35, "c" => 2, "a" => 1 } + * h3 = { "a" => 1, "c" => 2, 7 => 35 } + * h4 = { "a" => 1, "d" => 2, "f" => 35 } + * h1 == h2 #=> false + * h2 == h3 #=> true + * h3 == h4 #=> false + * + */ + +static mrb_value +mrb_hash_equal(mrb_state *mrb, mrb_value hash1) +{ + mrb_value hash2; + + mrb_get_args(mrb, "o", &hash2); + return hash_equal(mrb, hash1, hash2, FALSE); +} + +/* 15.2.13.4.32 (x)*/ +/* + * call-seq: + * hash.eql?(other) -> true or false + * + * Returns <code>true</code> if <i>hash</i> and <i>other</i> are + * both hashes with the same content. + */ + +static mrb_value +mrb_hash_eql(mrb_state *mrb, mrb_value hash1) +{ + mrb_value hash2; + + mrb_get_args(mrb, "o", &hash2); + return hash_equal(mrb, hash1, hash2, TRUE); +} + +/* + * call-seq: + * hsh.merge!(other_hash) -> hsh + * hsh.update(other_hash) -> hsh + * hsh.merge!(other_hash){|key, oldval, newval| block} -> hsh + * hsh.update(other_hash){|key, oldval, newval| block} -> hsh + * + * Adds the contents of <i>other_hash</i> to <i>hsh</i>. If no + * block is specified, entries with duplicate keys are overwritten + * with the values from <i>other_hash</i>, otherwise the value + * of each duplicate key is determined by calling the block with + * the key, its value in <i>hsh</i> and its value in <i>other_hash</i>. + * + * h1 = { "a" => 100, "b" => 200 } + * h2 = { "b" => 254, "c" => 300 } + * h1.merge!(h2) #=> {"a"=>100, "b"=>254, "c"=>300} + * + * h1 = { "a" => 100, "b" => 200 } + * h2 = { "b" => 254, "c" => 300 } + * h1.merge!(h2) { |key, v1, v2| v1 } + * #=> {"a"=>100, "b"=>200, "c"=>300} + */ + +/* 15.2.13.4.22 */ +/* + * call-seq: + * hsh.merge(other_hash) -> new_hash + * hsh.merge(other_hash){|key, oldval, newval| block} -> new_hash + * + * Returns a new hash containing the contents of <i>other_hash</i> and + * the contents of <i>hsh</i>. If no block is specified, the value for + * entries with duplicate keys will be that of <i>other_hash</i>. Otherwise + * the value for each duplicate key is determined by calling the block + * with the key, its value in <i>hsh</i> and its value in <i>other_hash</i>. + * + * h1 = { "a" => 100, "b" => 200 } + * h2 = { "b" => 254, "c" => 300 } + * h1.merge(h2) #=> {"a"=>100, "b"=>254, "c"=>300} + * h1.merge(h2){|key, oldval, newval| newval - oldval} + * #=> {"a"=>100, "b"=>54, "c"=>300} + * h1 #=> {"a"=>100, "b"=>200} + * + */ + +/* + * call-seq: + * hash.assoc(obj) -> an_array or nil + * + * Searches through the hash comparing _obj_ with the key using <code>==</code>. + * Returns the key-value pair (two elements array) or +nil+ + * if no match is found. See <code>Array#assoc</code>. + * + * h = {"colors" => ["red", "blue", "green"], + * "letters" => ["a", "b", "c" ]} + * h.assoc("letters") #=> ["letters", ["a", "b", "c"]] + * h.assoc("foo") #=> nil + */ + +mrb_value +mrb_hash_assoc(mrb_state *mrb, mrb_value hash) +{ + mrb_value key, value, has_key; + + mrb_get_args(mrb, "o", &key); + if (mrb_nil_p(key)) + mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments"); + + has_key = mrb_hash_has_keyWithKey(mrb, hash, key); + if (mrb_test(has_key)) { + value = mrb_hash_get(mrb, hash, key); + return mrb_assoc_new(mrb, key, value); + } + else { + return mrb_nil_value(); + } +} + +/* + * call-seq: + * hash.rassoc(key) -> an_array or nil + * + * Searches through the hash comparing _obj_ with the value using <code>==</code>. + * Returns the first key-value pair (two-element array) that matches. See + * also <code>Array#rassoc</code>. + * + * a = {1=> "one", 2 => "two", 3 => "three", "ii" => "two"} + * a.rassoc("two") #=> [2, "two"] + * a.rassoc("four") #=> nil + */ + +mrb_value +mrb_hash_rassoc(mrb_state *mrb, mrb_value hash) +{ + mrb_value key, value, has_key; + + mrb_get_args(mrb, "o", &key); + has_key = mrb_hash_has_keyWithKey(mrb, hash, key); + if (mrb_test(has_key)) { + value = mrb_hash_get(mrb, hash, key); + return mrb_assoc_new(mrb, value, key); + } + else { + return mrb_nil_value(); + } +} + +/* + * call-seq: + * hash.flatten -> an_array + * hash.flatten(level) -> an_array + * + * Returns a new array that is a one-dimensional flattening of this + * hash. That is, for every key or value that is an array, extract + * its elements into the new array. Unlike Array#flatten, this + * method does not flatten recursively by default. The optional + * <i>level</i> argument determines the level of recursion to flatten. + * + * a = {1=> "one", 2 => [2,"two"], 3 => "three"} + * a.flatten # => [1, "one", 2, [2, "two"], 3, "three"] + * a.flatten(2) # => [1, "one", 2, 2, "two", 3, "three"] + */ + +/* + * A <code>Hash</code> is a collection of key-value pairs. It is + * similar to an <code>Array</code>, except that indexing is done via + * arbitrary keys of any object type, not an integer index. Hashes enumerate + * their values in the order that the corresponding keys were inserted. + * + * Hashes have a <em>default value</em> that is returned when accessing + * keys that do not exist in the hash. By default, that value is + * <code>nil</code>. + * + */ + +void +mrb_init_hash(mrb_state *mrb) +{ + struct RClass *h; + + h = mrb->hash_class = mrb_define_class(mrb, "Hash", mrb->object_class); + MRB_SET_INSTANCE_TT(h, MRB_TT_HASH); + + mrb_include_module(mrb, h, mrb_class_get(mrb, "Enumerable")); + mrb_define_method(mrb, h, "==", mrb_hash_equal, ARGS_REQ(1)); /* 15.2.13.4.1 */ + mrb_define_method(mrb, h, "[]", mrb_hash_aget, ARGS_REQ(1)); /* 15.2.13.4.2 */ + mrb_define_method(mrb, h, "[]=", mrb_hash_aset, ARGS_REQ(2)); /* 15.2.13.4.3 */ + mrb_define_method(mrb, h, "clear", mrb_hash_clear, ARGS_NONE()); /* 15.2.13.4.4 */ + mrb_define_method(mrb, h, "default", mrb_hash_default, ARGS_ANY()); /* 15.2.13.4.5 */ + mrb_define_method(mrb, h, "default=", mrb_hash_set_default, ARGS_REQ(1)); /* 15.2.13.4.6 */ + mrb_define_method(mrb, h, "default_proc", mrb_hash_default_proc,ARGS_NONE()); /* 15.2.13.4.7 */ + mrb_define_method(mrb, h, "default_proc=", mrb_hash_set_default_proc,ARGS_REQ(1)); /* 15.2.13.4.7 */ + mrb_define_method(mrb, h, "__delete", mrb_hash_delete, ARGS_REQ(1)); /* core of 15.2.13.4.8 */ +// "each" 15.2.13.4.9 move to mrblib/hash.rb +// "each_key" 15.2.13.4.10 move to mrblib/hash.rb +// "each_value" 15.2.13.4.11 move to mrblib/hash.rb + mrb_define_method(mrb, h, "empty?", mrb_hash_empty_p, ARGS_NONE()); /* 15.2.13.4.12 */ + mrb_define_method(mrb, h, "has_key?", mrb_hash_has_key, ARGS_REQ(1)); /* 15.2.13.4.13 */ + mrb_define_method(mrb, h, "has_value?", mrb_hash_has_value, ARGS_REQ(1)); /* 15.2.13.4.14 */ + mrb_define_method(mrb, h, "include?", mrb_hash_has_key, ARGS_REQ(1)); /* 15.2.13.4.15 */ + mrb_define_method(mrb, h, "__init_core", mrb_hash_init_core, ARGS_ANY()); /* core of 15.2.13.4.16 */ + mrb_define_method(mrb, h, "initialize_copy", mrb_hash_replace, ARGS_REQ(1)); /* 15.2.13.4.17 */ + mrb_define_method(mrb, h, "key?", mrb_hash_has_key, ARGS_REQ(1)); /* 15.2.13.4.18 */ + mrb_define_method(mrb, h, "keys", mrb_hash_keys, ARGS_NONE()); /* 15.2.13.4.19 */ + mrb_define_method(mrb, h, "length", mrb_hash_size_m, ARGS_NONE()); /* 15.2.13.4.20 */ + mrb_define_method(mrb, h, "member?", mrb_hash_has_key, ARGS_REQ(1)); /* 15.2.13.4.21 */ +// "merge" 15.2.13.4.22 move to mrblib/hash.rb + mrb_define_method(mrb, h, "replace", mrb_hash_replace, ARGS_REQ(1)); /* 15.2.13.4.23 */ + mrb_define_method(mrb, h, "shift", mrb_hash_shift, ARGS_NONE()); /* 15.2.13.4.24 */ + mrb_define_method(mrb, h, "size", mrb_hash_size_m, ARGS_NONE()); /* 15.2.13.4.25 */ + mrb_define_method(mrb, h, "store", mrb_hash_aset, ARGS_REQ(2)); /* 15.2.13.4.26 */ + mrb_define_method(mrb, h, "value?", mrb_hash_has_value, ARGS_REQ(1)); /* 15.2.13.4.27 */ + mrb_define_method(mrb, h, "values", mrb_hash_values, ARGS_NONE()); /* 15.2.13.4.28 */ + + mrb_define_method(mrb, h, "to_hash", mrb_hash_to_hash, ARGS_NONE()); /* 15.2.13.4.29 (x)*/ + mrb_define_method(mrb, h, "inspect", mrb_hash_inspect, ARGS_NONE()); /* 15.2.13.4.30 (x)*/ + mrb_define_alias(mrb, h, "to_s", "inspect"); /* 15.2.13.4.31 (x)*/ + mrb_define_method(mrb, h, "eql?", mrb_hash_eql, ARGS_REQ(1)); /* 15.2.13.4.32 (x)*/ +} Added: vendor/mruby-b5830ae/src/init.c (+72 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/init.c 2013-01-09 13:19:18 +0900 (48008b1) @@ -0,0 +1,72 @@ +/* +** init.c - initialize mruby core +** +** See Copyright Notice in mruby.h +*/ + +#include "mruby.h" + +void mrb_init_symtbl(mrb_state*); +void mrb_init_class(mrb_state*); +void mrb_init_object(mrb_state*); +void mrb_init_kernel(mrb_state*); +void mrb_init_comparable(mrb_state*); +void mrb_init_enumerable(mrb_state*); +void mrb_init_symbol(mrb_state*); +void mrb_init_exception(mrb_state*); +void mrb_init_proc(mrb_state*); +void mrb_init_string(mrb_state*); +void mrb_init_array(mrb_state*); +void mrb_init_hash(mrb_state*); +void mrb_init_numeric(mrb_state*); +void mrb_init_range(mrb_state*); +void mrb_init_struct(mrb_state*); +void mrb_init_gc(mrb_state*); +void mrb_init_regexp(mrb_state*); +void mrb_init_print(mrb_state*); +void mrb_init_time(mrb_state*); +void mrb_init_math(mrb_state*); +void mrb_init_mrblib(mrb_state*); +void mrb_init_mrbgems(mrb_state*); + +#define DONE mrb_gc_arena_restore(mrb, 0); +void +mrb_init_core(mrb_state *mrb) +{ + mrb_init_symtbl(mrb); DONE; + + mrb_init_class(mrb); DONE; + mrb_init_object(mrb); DONE; + mrb_init_kernel(mrb); DONE; + mrb_init_comparable(mrb); DONE; + mrb_init_enumerable(mrb); DONE; + + mrb_init_symbol(mrb); DONE; + mrb_init_exception(mrb); DONE; + mrb_init_proc(mrb); DONE; + mrb_init_string(mrb); DONE; + mrb_init_array(mrb); DONE; + mrb_init_hash(mrb); DONE; + mrb_init_numeric(mrb); DONE; + mrb_init_range(mrb); DONE; +#ifdef ENABLE_STRUCT + mrb_init_struct(mrb); DONE; +#endif + mrb_init_gc(mrb); DONE; +#ifdef ENABLE_REGEXP + mrb_init_regexp(mrb); DONE; +#endif +#ifdef ENABLE_STDIO + mrb_init_print(mrb); DONE; +#endif +#ifdef ENABLE_TIME + mrb_init_time(mrb); DONE; +#endif +#ifdef ENABLE_MATH + mrb_init_math(mrb); DONE; +#endif + mrb_init_mrblib(mrb); DONE; +#ifndef DISABLE_GEMS + mrb_init_mrbgems(mrb); DONE; +#endif +} Added: vendor/mruby-b5830ae/src/init_ext.c (+16 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/init_ext.c 2013-01-09 13:19:18 +0900 (96ee34d) @@ -0,0 +1,16 @@ +/* +** init_ext.c - initialize extend libraries +** +** See Copyright Notice in mruby.h +*/ + +#include "mruby.h" + +void +mrb_init_ext(mrb_state *mrb) +{ +#ifdef INCLUDE_SOCKET + extern void mrb_init_socket(mrb_state *mrb); + mrb_init_socket(mrb); +#endif +} Added: vendor/mruby-b5830ae/src/kernel.c (+1127 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/kernel.c 2013-01-09 13:19:18 +0900 (5e8a2f5) @@ -0,0 +1,1127 @@ +/* +** kernel.c - Kernel module +** +** See Copyright Notice in mruby.h +*/ + +#include "mruby.h" +#include "mruby/string.h" +#include "mruby/proc.h" +#include "mruby/array.h" +#include "mruby/class.h" +#include "mruby/variable.h" +#include "error.h" + +typedef enum { + NOEX_PUBLIC = 0x00, + NOEX_NOSUPER = 0x01, + NOEX_PRIVATE = 0x02, + NOEX_PROTECTED = 0x04, + NOEX_MASK = 0x06, + NOEX_BASIC = 0x08, + NOEX_UNDEF = NOEX_NOSUPER, + NOEX_MODFUNC = 0x12, + NOEX_SUPER = 0x20, + NOEX_VCALL = 0x40, + NOEX_RESPONDS = 0x80 +} mrb_method_flag_t; + +struct obj_ivar_tag { + mrb_value obj; + int (*func)(mrb_sym key, mrb_value val, void * arg); + void * arg; +}; + +int +mrb_obj_basic_to_s_p(mrb_state *mrb, mrb_value obj) +{ + struct RProc *me = mrb_method_search(mrb, mrb_class(mrb, obj), mrb_intern(mrb, "to_s")); + if (me && MRB_PROC_CFUNC_P(me) && (me->body.func == mrb_any_to_s)) + return TRUE; + return FALSE; +} + +/* 15.3.1.3.17 */ +/* + * call-seq: + * obj.inspect -> string + * + * Returns a string containing a human-readable representation of + * <i>obj</i>. If not overridden and no instance variables, uses the + * <code>to_s</code> method to generate the string. + * <i>obj</i>. If not overridden, uses the <code>to_s</code> method to + * generate the string. + * + * [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]" + * Time.new.inspect #=> "2008-03-08 19:43:39 +0900" + */ +mrb_value +mrb_obj_inspect(mrb_state *mrb, mrb_value obj) +{ + if ((mrb_type(obj) == MRB_TT_OBJECT) && mrb_obj_basic_to_s_p(mrb, obj)) { + return mrb_obj_iv_inspect(mrb, mrb_obj_ptr(obj)); + } + else if (mrb_type(obj) == MRB_TT_MAIN) { + return mrb_str_new(mrb, "main", 4); + } + return mrb_any_to_s(mrb, obj); +} + +/* 15.3.1.3.1 */ +/* 15.3.1.3.10 */ +/* 15.3.1.3.11 */ +/* + * call-seq: + * obj == other -> true or false + * obj.equal?(other) -> true or false + * obj.eql?(other) -> true or false + * + * Equality---At the <code>Object</code> level, <code>==</code> returns + * <code>true</code> only if <i>obj</i> and <i>other</i> are the + * same object. Typically, this method is overridden in descendant + * classes to provide class-specific meaning. + * + * Unlike <code>==</code>, the <code>equal?</code> method should never be + * overridden by subclasses: it is used to determine object identity + * (that is, <code>a.equal?(b)</code> iff <code>a</code> is the same + * object as <code>b</code>). + * + * The <code>eql?</code> method returns <code>true</code> if + * <i>obj</i> and <i>anObject</i> have the same value. Used by + * <code>Hash</code> to test members for equality. For objects of + * class <code>Object</code>, <code>eql?</code> is synonymous with + * <code>==</code>. Subclasses normally continue this tradition, but + * there are exceptions. <code>Numeric</code> types, for example, + * perform type conversion across <code>==</code>, but not across + * <code>eql?</code>, so: + * + * 1 == 1.0 #=> true + * 1.eql? 1.0 #=> false + */ +static mrb_value +mrb_obj_equal_m(mrb_state *mrb, mrb_value self) +{ + mrb_value arg; + + mrb_get_args(mrb, "o", &arg); + if (mrb_obj_equal(mrb, self, arg)) { + return mrb_true_value(); + } + else { + return mrb_false_value(); + } +} + +static mrb_value +mrb_obj_not_equal_m(mrb_state *mrb, mrb_value self) +{ + mrb_value arg; + + mrb_get_args(mrb, "o", &arg); + if (mrb_equal(mrb, self, arg)) { + return mrb_false_value(); + } + else { + return mrb_true_value(); + } +} + +/* 15.3.1.3.2 */ +/* + * call-seq: + * obj === other -> true or false + * + * Case Equality---For class <code>Object</code>, effectively the same + * as calling <code>#==</code>, but typically overridden by descendants + * to provide meaningful semantics in <code>case</code> statements. + */ +static mrb_value +mrb_equal_m(mrb_state *mrb, mrb_value self) +{ + mrb_value arg; + + mrb_get_args(mrb, "o", &arg); + if (mrb_equal(mrb, self, arg)){ + return mrb_true_value(); + } + else { + return mrb_false_value(); + } +} + +/* 15.3.1.3.3 */ +/* 15.3.1.3.33 */ +/* + * Document-method: __id__ + * Document-method: object_id + * + * call-seq: + * obj.__id__ -> fixnum + * obj.object_id -> fixnum + * + * Returns an integer identifier for <i>obj</i>. The same number will + * be returned on all calls to <code>id</code> for a given object, and + * no two active objects will share an id. + * <code>Object#object_id</code> is a different concept from the + * <code>:name</code> notation, which returns the symbol id of + * <code>name</code>. Replaces the deprecated <code>Object#id</code>. + */ +static mrb_value +mrb_obj_id_m(mrb_state *mrb, mrb_value self) +{ + return mrb_fixnum_value(mrb_obj_id(self)); +} + +/* 15.3.1.3.4 */ +/* 15.3.1.3.44 */ +/* + * call-seq: + * obj.send(symbol [, args...]) -> obj + * obj.__send__(symbol [, args...]) -> obj + * + * Invokes the method identified by _symbol_, passing it any + * arguments specified. You can use <code>__send__</code> if the name + * +send+ clashes with an existing method in _obj_. + * + * class Klass + * def hello(*args) + * "Hello " + args.join(' ') + * end + * end + * k = Klass.new + * k.send :hello, "gentle", "readers" #=> "Hello gentle readers" + */ +static mrb_value +mrb_f_send(mrb_state *mrb, mrb_value self) +{ + mrb_sym name; + mrb_value block, *argv; + int argc; + + mrb_get_args(mrb, "n*&", &name, &argv, &argc, &block); + return mrb_funcall_with_block(mrb,self, name, argc, argv, block); +} + +/* 15.3.1.2.2 */ +/* 15.3.1.2.5 */ +/* 15.3.1.3.6 */ +/* 15.3.1.3.25 */ +/* + * call-seq: + * block_given? -> true or false + * iterator? -> true or false + * + * Returns <code>true</code> if <code>yield</code> would execute a + * block in the current context. The <code>iterator?</code> form + * is mildly deprecated. + * + * def try + * if block_given? + * yield + * else + * "no block" + * end + * end + * try #=> "no block" + * try { "hello" } #=> "hello" + * try do "hello" end #=> "hello" + */ +static mrb_value +mrb_f_block_given_p_m(mrb_state *mrb, mrb_value self) +{ + mrb_callinfo *ci = mrb->ci; + mrb_value *bp; + + bp = mrb->stbase + ci->stackidx + 1; + ci--; + if (ci <= mrb->cibase) return mrb_false_value(); + /* block_given? called within block; check upper scope */ + if (ci->proc->env && ci->proc->env->stack) { + if (ci->proc->env->stack == mrb->stbase || mrb_nil_p(ci->proc->env->stack[1])) + return mrb_false_value(); + return mrb_true_value(); + } + if (ci->argc > 0) { + bp += ci->argc; + } + if (mrb_nil_p(*bp)) return mrb_false_value(); + return mrb_true_value(); +} + +/* 15.3.1.3.7 */ +/* + * call-seq: + * obj.class -> class + * + * Returns the class of <i>obj</i>. This method must always be + * called with an explicit receiver, as <code>class</code> is also a + * reserved word in Ruby. + * + * 1.class #=> Fixnum + * self.class #=> Object + */ +static mrb_value +mrb_obj_class_m(mrb_state *mrb, mrb_value self) +{ + return mrb_obj_value(mrb_obj_class(mrb, self)); +} + +struct RClass* +mrb_singleton_class_clone(mrb_state *mrb, mrb_value obj) +{ + struct RClass *klass = mrb_basic(obj)->c; + + if (klass->tt != MRB_TT_SCLASS) + return klass; + else { + /* copy singleton(unnamed) class */ + struct RClass *clone = (struct RClass*)mrb_obj_alloc(mrb, klass->tt, mrb->class_class); + + if ((mrb_type(obj) == MRB_TT_CLASS) || + (mrb_type(obj) == MRB_TT_SCLASS)) { /* BUILTIN_TYPE(obj) == T_CLASS */ + clone->c = clone; + } + else { + clone->c = mrb_singleton_class_clone(mrb, mrb_obj_value(klass)); + } + + clone->super = klass->super; + if (klass->iv) { + mrb_iv_copy(mrb, mrb_obj_value(clone), mrb_obj_value(klass)); + mrb_obj_iv_set(mrb, (struct RObject*)clone, mrb_intern(mrb, "__attached__"), obj); + } + if (klass->mt) { + clone->mt = kh_copy(mt, mrb, klass->mt); + } + else { + clone->mt = kh_init(mt, mrb); + } + clone->tt = MRB_TT_SCLASS; + return clone; + } +} + +static void +init_copy(mrb_state *mrb, mrb_value dest, mrb_value obj) +{ + switch (mrb_type(obj)) { + case MRB_TT_OBJECT: + case MRB_TT_CLASS: + case MRB_TT_MODULE: + case MRB_TT_SCLASS: + case MRB_TT_HASH: + case MRB_TT_DATA: + mrb_iv_copy(mrb, dest, obj); + break; + + default: + break; + } + mrb_funcall(mrb, dest, "initialize_copy", 1, obj); +} + +/* 15.3.1.3.8 */ +/* + * call-seq: + * obj.clone -> an_object + * + * Produces a shallow copy of <i>obj</i>---the instance variables of + * <i>obj</i> are copied, but not the objects they reference. Copies + * the frozen state of <i>obj</i>. See also the discussion + * under <code>Object#dup</code>. + * + * class Klass + * attr_accessor :str + * end + * s1 = Klass.new #=> #<Klass:0x401b3a38> + * s1.str = "Hello" #=> "Hello" + * s2 = s1.clone #=> #<Klass:0x401b3998 @str="Hello"> + * s2.str[1,4] = "i" #=> "i" + * s1.inspect #=> "#<Klass:0x401b3a38 @str=\"Hi\">" + * s2.inspect #=> "#<Klass:0x401b3998 @str=\"Hi\">" + * + * This method may have class-specific behavior. If so, that + * behavior will be documented under the #+initialize_copy+ method of + * the class. + * + * Some Class(True False Nil Symbol Fixnum Float) Object cannot clone. + */ +mrb_value +mrb_obj_clone(mrb_state *mrb, mrb_value self) +{ + struct RObject *p; + mrb_value clone; + + if (mrb_special_const_p(self)) { + mrb_raisef(mrb, E_TYPE_ERROR, "can't clone %s", mrb_obj_classname(mrb, self)); + } + p = (struct RObject*)mrb_obj_alloc(mrb, mrb_type(self), mrb_obj_class(mrb, self)); + p->c = mrb_singleton_class_clone(mrb, self); + clone = mrb_obj_value(p); + init_copy(mrb, clone, self); + + return clone; +} + +/* 15.3.1.3.9 */ +/* + * call-seq: + * obj.dup -> an_object + * + * Produces a shallow copy of <i>obj</i>---the instance variables of + * <i>obj</i> are copied, but not the objects they reference. + * <code>dup</code> copies the frozen state of <i>obj</i>. See also + * the discussion under <code>Object#clone</code>. In general, + * <code>clone</code> and <code>dup</code> may have different semantics + * in descendant classes. While <code>clone</code> is used to duplicate + * an object, including its internal state, <code>dup</code> typically + * uses the class of the descendant object to create the new instance. + * + * This method may have class-specific behavior. If so, that + * behavior will be documented under the #+initialize_copy+ method of + * the class. + */ + +mrb_value +mrb_obj_dup(mrb_state *mrb, mrb_value obj) +{ + struct RBasic *p; + mrb_value dup; + + if (mrb_special_const_p(obj)) { + mrb_raisef(mrb, E_TYPE_ERROR, "can't dup %s", mrb_obj_classname(mrb, obj)); + } + p = mrb_obj_alloc(mrb, mrb_type(obj), mrb_obj_class(mrb, obj)); + dup = mrb_obj_value(p); + init_copy(mrb, dup, obj); + + return dup; +} + +static mrb_value +mrb_obj_extend(mrb_state *mrb, int argc, mrb_value *argv, mrb_value obj) +{ + int i; + + if (argc == 0) { + mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments (at least 1)"); + } + for (i = 0; i < argc; i++) { + mrb_check_type(mrb, argv[i], MRB_TT_MODULE); + } + while (argc--) { + mrb_funcall(mrb, argv[argc], "extend_object", 1, obj); + mrb_funcall(mrb, argv[argc], "extended", 1, obj); + } + return obj; +} + +/* 15.3.1.3.13 */ +/* + * call-seq: + * obj.extend(module, ...) -> obj + * + * Adds to _obj_ the instance methods from each module given as a + * parameter. + * + * module Mod + * def hello + * "Hello from Mod.\n" + * end + * end + * + * class Klass + * def hello + * "Hello from Klass.\n" + * end + * end + * + * k = Klass.new + * k.hello #=> "Hello from Klass.\n" + * k.extend(Mod) #=> #<Klass:0x401b3bc8> + * k.hello #=> "Hello from Mod.\n" + */ +mrb_value +mrb_obj_extend_m(mrb_state *mrb, mrb_value self) +{ + mrb_value *argv; + int argc; + + mrb_get_args(mrb, "*", &argv, &argc); + return mrb_obj_extend(mrb, argc, argv, self); +} + +/* 15.3.1.3.15 */ +/* + * call-seq: + * obj.hash -> fixnum + * + * Generates a <code>Fixnum</code> hash value for this object. This + * function must have the property that <code>a.eql?(b)</code> implies + * <code>a.hash == b.hash</code>. The hash value is used by class + * <code>Hash</code>. Any hash value that exceeds the capacity of a + * <code>Fixnum</code> will be truncated before being used. + */ +mrb_value +mrb_obj_hash(mrb_state *mrb, mrb_value self) +{ + return mrb_fixnum_value(mrb_obj_id(self)); +} + +/* 15.3.1.3.16 */ +mrb_value +mrb_obj_init_copy(mrb_state *mrb, mrb_value self) +{ + mrb_value orig; + + mrb_get_args(mrb, "o", &orig); + if (mrb_obj_equal(mrb, self, orig)) return self; + if ((mrb_type(self) != mrb_type(orig)) || (mrb_obj_class(mrb, self) != mrb_obj_class(mrb, orig))) { + mrb_raise(mrb, E_TYPE_ERROR, "initialize_copy should take same class object"); + } + return self; +} + +mrb_value mrb_yield_internal(mrb_state *mrb, mrb_value b, int argc, mrb_value *argv, mrb_value self, struct RClass *c); + +/* 15.3.1.3.18 */ +/* + * call-seq: + * obj.instance_eval {| | block } -> obj + * + * Evaluates the given block,within the context of the receiver (_obj_). + * In order to set the context, the variable +self+ is set to _obj_ while + * the code is executing, giving the code access to _obj_'s + * instance variables. In the version of <code>instance_eval</code> + * that takes a +String+, the optional second and third + * parameters supply a filename and starting line number that are used + * when reporting compilation errors. + * + * class KlassWithSecret + * def initialize + * @secret = 99 + * end + * end + * k = KlassWithSecret.new + * k.instance_eval { @secret } #=> 99 + */ +mrb_value +mrb_obj_instance_eval(mrb_state *mrb, mrb_value self) +{ + mrb_value a, b; + mrb_value cv; + struct RClass *c; + + if (mrb_get_args(mrb, "|S&", &a, &b) == 1) { + mrb_raise(mrb, E_NOTIMP_ERROR, "instance_eval with string not implemented"); + } + switch (mrb_type(self)) { + case MRB_TT_SYMBOL: + case MRB_TT_FIXNUM: + case MRB_TT_FLOAT: + c = 0; + break; + default: + cv = mrb_singleton_class(mrb, self); + c = mrb_class_ptr(cv); + } + return mrb_yield_internal(mrb, b, 0, 0, self, c); +} + +int +mrb_obj_is_instance_of(mrb_state *mrb, mrb_value obj, struct RClass* c) +{ + if (mrb_obj_class(mrb, obj) == c) return TRUE; + return FALSE; +} + +/* 15.3.1.3.19 */ +/* + * call-seq: + * obj.instance_of?(class) -> true or false + * + * Returns <code>true</code> if <i>obj</i> is an instance of the given + * class. See also <code>Object#kind_of?</code>. + */ +static mrb_value +obj_is_instance_of(mrb_state *mrb, mrb_value self) +{ + mrb_value arg; + + mrb_get_args(mrb, "o", &arg); + if (mrb_obj_is_instance_of(mrb, self, mrb_class_ptr(arg))){ + return mrb_true_value(); + } + else { + return mrb_false_value(); + } +} + +static void +check_iv_name(mrb_state *mrb, mrb_sym id) +{ + const char *s; + int len; + + s = mrb_sym2name_len(mrb, id, &len); + if (len < 2 || !(s[0] == '@' && s[1] != '@')) { + mrb_name_error(mrb, id, "`%s' is not allowed as an instance variable name", s); + } +} + +/* 15.3.1.3.20 */ +/* + * call-seq: + * obj.instance_variable_defined?(symbol) -> true or false + * + * Returns <code>true</code> if the given instance variable is + * defined in <i>obj</i>. + * + * class Fred + * def initialize(p1, p2) + * @a, @b = p1, p2 + * end + * end + * fred = Fred.new('cat', 99) + * fred.instance_variable_defined?(:@a) #=> true + * fred.instance_variable_defined?("@b") #=> true + * fred.instance_variable_defined?("@c") #=> false + */ +mrb_value +mrb_obj_ivar_defined(mrb_state *mrb, mrb_value self) +{ + mrb_sym mid; + + mrb_get_args(mrb, "n", &mid); + check_iv_name(mrb, mid); + if (mrb_obj_iv_defined(mrb, mrb_obj_ptr(self), mid)) + return mrb_true_value(); + return mrb_false_value(); +} + +/* 15.3.1.3.21 */ +/* + * call-seq: + * obj.instance_variable_get(symbol) -> obj + * + * Returns the value of the given instance variable, or nil if the + * instance variable is not set. The <code>@</code> part of the + * variable name should be included for regular instance + * variables. Throws a <code>NameError</code> exception if the + * supplied symbol is not valid as an instance variable name. + * + * class Fred + * def initialize(p1, p2) + * @a, @b = p1, p2 + * end + * end + * fred = Fred.new('cat', 99) + * fred.instance_variable_get(:@a) #=> "cat" + * fred.instance_variable_get("@b") #=> 99 + */ +mrb_value +mrb_obj_ivar_get(mrb_state *mrb, mrb_value self) +{ + mrb_sym id; + + mrb_get_args(mrb, "n", &id); + + check_iv_name(mrb, id); + return mrb_iv_get(mrb, self, id); +} + +/* 15.3.1.3.22 */ +/* + * call-seq: + * obj.instance_variable_set(symbol, obj) -> obj + * + * Sets the instance variable names by <i>symbol</i> to + * <i>object</i>, thereby frustrating the efforts of the class's + * author to attempt to provide proper encapsulation. The variable + * did not have to exist prior to this call. + * + * class Fred + * def initialize(p1, p2) + * @a, @b = p1, p2 + * end + * end + * fred = Fred.new('cat', 99) + * fred.instance_variable_set(:@a, 'dog') #=> "dog" + * fred.instance_variable_set(:@c, 'cat') #=> "cat" + * fred.inspect #=> "#<Fred:0x401b3da8 @a=\"dog\", @b=99, @c=\"cat\">" + */ +mrb_value +mrb_obj_ivar_set(mrb_state *mrb, mrb_value self) +{ + mrb_sym id; + mrb_value val; + + mrb_get_args(mrb, "no", &id, &val); + check_iv_name(mrb, id); + mrb_iv_set(mrb, self, id, val); + return val; +} + +/* 15.3.1.3.24 */ +/* 15.3.1.3.26 */ +/* + * call-seq: + * obj.is_a?(class) -> true or false + * obj.kind_of?(class) -> true or false + * + * Returns <code>true</code> if <i>class</i> is the class of + * <i>obj</i>, or if <i>class</i> is one of the superclasses of + * <i>obj</i> or modules included in <i>obj</i>. + * + * module M; end + * class A + * include M + * end + * class B < A; end + * class C < B; end + * b = B.new + * b.instance_of? A #=> false + * b.instance_of? B #=> true + * b.instance_of? C #=> false + * b.instance_of? M #=> false + * b.kind_of? A #=> true + * b.kind_of? B #=> true + * b.kind_of? C #=> false + * b.kind_of? M #=> true + */ +mrb_value +mrb_obj_is_kind_of_m(mrb_state *mrb, mrb_value self) +{ + mrb_value arg; + + mrb_get_args(mrb, "o", &arg); + if (mrb_obj_is_kind_of(mrb, self, mrb_class_ptr(arg))) { + return mrb_true_value(); + } + else { + return mrb_false_value(); + } +} + +static void +method_entry_loop(mrb_state *mrb, struct RClass* klass, mrb_value ary) +{ + khint_t i; + + khash_t(mt) *h = klass->mt; + if (!h) return; + for (i=0;i<kh_end(h);i++) { + if (kh_exist(h, i)) { + mrb_ary_push(mrb, ary, mrb_symbol_value(kh_key(h,i))); + } + } +} + +mrb_value +class_instance_method_list(mrb_state *mrb, int argc, mrb_value *argv, struct RClass* klass, int obj) +{ + mrb_value ary; + int recur; + struct RClass* oldklass; + + if (argc == 0) { + recur = TRUE; + } + else { + mrb_value r; + + mrb_get_args(mrb, "o", &r); + recur = mrb_test(r); + } + ary = mrb_ary_new(mrb); + oldklass = 0; + while (klass && (klass != oldklass)) { + method_entry_loop(mrb, klass, ary); + if ((klass->tt == MRB_TT_ICLASS) || + (klass->tt == MRB_TT_SCLASS)) { + } + else { + if (!recur) break; + } + oldklass = klass; + klass = klass->super; + } + + return ary; +} + +mrb_value +mrb_obj_singleton_methods(mrb_state *mrb, int argc, mrb_value *argv, mrb_value obj) +{ + mrb_value recur, ary; + struct RClass* klass; + + if (argc == 0) { + recur = mrb_true_value(); + } + else { + recur = argv[0]; + } + klass = mrb_class(mrb, obj); + ary = mrb_ary_new(mrb); + if (klass && (klass->tt == MRB_TT_SCLASS)) { + method_entry_loop(mrb, klass, ary); + klass = klass->super; + } + if (mrb_test(recur)) { + while (klass && ((klass->tt == MRB_TT_SCLASS) || (klass->tt == MRB_TT_ICLASS))) { + method_entry_loop(mrb, klass, ary); + klass = klass->super; + } + } + + return ary; +} + +mrb_value +mrb_obj_methods(mrb_state *mrb, int argc, mrb_value *argv, mrb_value obj, mrb_method_flag_t flag) +{ +retry: + if (argc == 0) { + return class_instance_method_list(mrb, argc, argv, mrb_class(mrb, obj), 0); + } + else { + mrb_value recur; + + recur = argv[0]; + if (mrb_test(recur)) { + argc = 0; + goto retry; + } + return mrb_obj_singleton_methods(mrb, argc, argv, obj); + } +} +/* 15.3.1.3.31 */ +/* + * call-seq: + * obj.methods -> array + * + * Returns a list of the names of methods publicly accessible in + * <i>obj</i>. This will include all the methods accessible in + * <i>obj</i>'s ancestors. + * + * class Klass + * def kMethod() + * end + * end + * k = Klass.new + * k.methods[0..9] #=> [:kMethod, :freeze, :nil?, :is_a?, + * # :class, :instance_variable_set, + * # :methods, :extend, :__send__, :instance_eval] + * k.methods.length #=> 42 + */ +mrb_value +mrb_obj_methods_m(mrb_state *mrb, mrb_value self) +{ + mrb_value *argv; + int argc; + + mrb_get_args(mrb, "*", &argv, &argc); + return mrb_obj_methods(mrb, argc, argv, self, (mrb_method_flag_t)0); /* everything but private */ +} + +/* 15.3.1.3.32 */ +/* + * call_seq: + * nil.nil? -> true + * <anything_else>.nil? -> false + * + * Only the object <i>nil</i> responds <code>true</code> to <code>nil?</code>. + */ +mrb_value +mrb_false(mrb_state *mrb, mrb_value self) +{ + return mrb_false_value(); +} + +/* 15.3.1.3.36 */ +/* + * call-seq: + * obj.private_methods(all=true) -> array + * + * Returns the list of private methods accessible to <i>obj</i>. If + * the <i>all</i> parameter is set to <code>false</code>, only those methods + * in the receiver will be listed. + */ +mrb_value +mrb_obj_private_methods(mrb_state *mrb, mrb_value self) +{ + mrb_value *argv; + int argc; + + mrb_get_args(mrb, "*", &argv, &argc); + return mrb_obj_methods(mrb, argc, argv, self, NOEX_PRIVATE); /* private attribute not define */ +} + +/* 15.3.1.3.37 */ +/* + * call-seq: + * obj.protected_methods(all=true) -> array + * + * Returns the list of protected methods accessible to <i>obj</i>. If + * the <i>all</i> parameter is set to <code>false</code>, only those methods + * in the receiver will be listed. + */ +mrb_value +mrb_obj_protected_methods(mrb_state *mrb, mrb_value self) +{ + mrb_value *argv; + int argc; + + mrb_get_args(mrb, "*", &argv, &argc); + return mrb_obj_methods(mrb, argc, argv, self, NOEX_PROTECTED); /* protected attribute not define */ +} + +/* 15.3.1.3.38 */ +/* + * call-seq: + * obj.public_methods(all=true) -> array + * + * Returns the list of public methods accessible to <i>obj</i>. If + * the <i>all</i> parameter is set to <code>false</code>, only those methods + * in the receiver will be listed. + */ +mrb_value +mrb_obj_public_methods(mrb_state *mrb, mrb_value self) +{ + mrb_value *argv; + int argc; + + mrb_get_args(mrb, "*", &argv, &argc); + return mrb_obj_methods(mrb, argc, argv, self, NOEX_PUBLIC); /* public attribute not define */ +} + +/* 15.3.1.2.12 */ +/* 15.3.1.3.40 */ +/* + * call-seq: + * raise + * raise(string) + * raise(exception [, string]) + * + * With no arguments, raises a <code>RuntimeError</code> + * With a single +String+ argument, raises a + * +RuntimeError+ with the string as a message. Otherwise, + * the first parameter should be the name of an +Exception+ + * class (or an object that returns an +Exception+ object when sent + * an +exception+ message). The optional second parameter sets the + * message associated with the exception, and the third parameter is an + * array of callback information. Exceptions are caught by the + * +rescue+ clause of <code>begin...end</code> blocks. + * + * raise "Failed to create socket" + * raise ArgumentError, "No parameters", caller + */ +mrb_value +mrb_f_raise(mrb_state *mrb, mrb_value self) +{ + mrb_value a[2], exc; + int argc; + + + argc = mrb_get_args(mrb, "|oo", &a[0], &a[1]); + switch (argc) { + case 0: + mrb_raise(mrb, E_RUNTIME_ERROR, ""); + break; + case 1: + a[1] = mrb_check_string_type(mrb, a[0]); + if (!mrb_nil_p(a[1])) { + argc = 2; + a[0] = mrb_obj_value(E_RUNTIME_ERROR); + } + /* fall through */ + default: + exc = mrb_make_exception(mrb, argc, a); + mrb_obj_iv_set(mrb, mrb_obj_ptr(exc), mrb_intern(mrb, "lastpc"), mrb_voidp_value(mrb->ci->pc)); + mrb_exc_raise(mrb, exc); + } + return mrb_nil_value(); /* not reached */ +} + +/* 15.3.1.3.41 */ +/* + * call-seq: + * obj.remove_instance_variable(symbol) -> obj + * + * Removes the named instance variable from <i>obj</i>, returning that + * variable's value. + * + * class Dummy + * attr_reader :var + * def initialize + * @var = 99 + * end + * def remove + * remove_instance_variable(:@var) + * end + * end + * d = Dummy.new + * d.var #=> 99 + * d.remove #=> 99 + * d.var #=> nil + */ +mrb_value +mrb_obj_remove_instance_variable(mrb_state *mrb, mrb_value self) +{ + mrb_sym sym; + mrb_value val; + + mrb_get_args(mrb, "n", &sym); + check_iv_name(mrb, sym); + val = mrb_iv_remove(mrb, self, sym); + if (mrb_undef_p(val)) { + mrb_name_error(mrb, sym, "instance variable %s not defined", mrb_sym2name(mrb, sym)); + } + return val; +} + +static inline int +basic_obj_respond_to(mrb_state *mrb, mrb_value obj, mrb_sym id, int pub) +{ + return mrb_respond_to(mrb, obj, id); +} +/* 15.3.1.3.43 */ +/* + * call-seq: + * obj.respond_to?(symbol, include_private=false) -> true or false + * + * Returns +true+ if _obj_ responds to the given + * method. Private methods are included in the search only if the + * optional second parameter evaluates to +true+. + * + * If the method is not implemented, + * as Process.fork on Windows, File.lchmod on GNU/Linux, etc., + * false is returned. + * + * If the method is not defined, <code>respond_to_missing?</code> + * method is called and the result is returned. + */ +mrb_value +obj_respond_to(mrb_state *mrb, mrb_value self) +{ + mrb_value *argv; + int argc; + mrb_value mid, priv; + mrb_sym id; + + mrb_get_args(mrb, "*", &argv, &argc); + mid = argv[0]; + if (argc > 1) priv = argv[1]; + else priv = mrb_nil_value(); + id = mrb_to_id(mrb, mid); + if (basic_obj_respond_to(mrb, self, id, !mrb_test(priv))) + return mrb_true_value(); + return mrb_false_value(); +} + +/* 15.3.1.3.45 */ +/* + * call-seq: + * obj.singleton_methods(all=true) -> array + * + * Returns an array of the names of singleton methods for <i>obj</i>. + * If the optional <i>all</i> parameter is true, the list will include + * methods in modules included in <i>obj</i>. + * Only public and protected singleton methods are returned. + * + * module Other + * def three() end + * end + * + * class Single + * def Single.four() end + * end + * + * a = Single.new + * + * def a.one() + * end + * + * class << a + * include Other + * def two() + * end + * end + * + * Single.singleton_methods #=> [:four] + * a.singleton_methods(false) #=> [:two, :one] + * a.singleton_methods #=> [:two, :one, :three] + */ +mrb_value +mrb_obj_singleton_methods_m(mrb_state *mrb, mrb_value self) +{ + mrb_value *argv; + int argc; + + mrb_get_args(mrb, "*", &argv, &argc); + return mrb_obj_singleton_methods(mrb, argc, argv, self); +} + +mrb_value mrb_f_sprintf(mrb_state *mrb, mrb_value obj); /* in sprintf.c */ + +void +mrb_init_kernel(mrb_state *mrb) +{ + struct RClass *krn; + + krn = mrb->kernel_module = mrb_define_module(mrb, "Kernel"); + mrb_define_class_method(mrb, krn, "block_given?", mrb_f_block_given_p_m, ARGS_NONE()); /* 15.3.1.2.2 */ + mrb_define_class_method(mrb, krn, "global_variables", mrb_f_global_variables, ARGS_NONE()); /* 15.3.1.2.4 */ + mrb_define_class_method(mrb, krn, "iterator?", mrb_f_block_given_p_m, ARGS_NONE()); /* 15.3.1.2.5 */ +; /* 15.3.1.2.11 */ + mrb_define_class_method(mrb, krn, "raise", mrb_f_raise, ARGS_ANY()); /* 15.3.1.2.12 */ + + mrb_define_method(mrb, krn, "singleton_class", mrb_singleton_class, ARGS_NONE()); + + mrb_define_method(mrb, krn, "==", mrb_obj_equal_m, ARGS_REQ(1)); /* 15.3.1.3.1 */ + mrb_define_method(mrb, krn, "!=", mrb_obj_not_equal_m, ARGS_REQ(1)); + mrb_define_method(mrb, krn, "===", mrb_equal_m, ARGS_REQ(1)); /* 15.3.1.3.2 */ + mrb_define_method(mrb, krn, "__id__", mrb_obj_id_m, ARGS_NONE()); /* 15.3.1.3.3 */ + mrb_define_method(mrb, krn, "__send__", mrb_f_send, ARGS_ANY()); /* 15.3.1.3.4 */ + mrb_define_method(mrb, krn, "block_given?", mrb_f_block_given_p_m, ARGS_NONE()); /* 15.3.1.3.6 */ + mrb_define_method(mrb, krn, "class", mrb_obj_class_m, ARGS_NONE()); /* 15.3.1.3.7 */ + mrb_define_method(mrb, krn, "clone", mrb_obj_clone, ARGS_NONE()); /* 15.3.1.3.8 */ + mrb_define_method(mrb, krn, "dup", mrb_obj_dup, ARGS_NONE()); /* 15.3.1.3.9 */ + mrb_define_method(mrb, krn, "eql?", mrb_obj_equal_m, ARGS_REQ(1)); /* 15.3.1.3.10 */ + mrb_define_method(mrb, krn, "equal?", mrb_obj_equal_m, ARGS_REQ(1)); /* 15.3.1.3.11 */ + mrb_define_method(mrb, krn, "extend", mrb_obj_extend_m, ARGS_ANY()); /* 15.3.1.3.13 */ + mrb_define_method(mrb, krn, "global_variables", mrb_f_global_variables, ARGS_NONE()); /* 15.3.1.3.14 */ + mrb_define_method(mrb, krn, "hash", mrb_obj_hash, ARGS_NONE()); /* 15.3.1.3.15 */ + mrb_define_method(mrb, krn, "initialize_copy", mrb_obj_init_copy, ARGS_REQ(1)); /* 15.3.1.3.16 */ + mrb_define_method(mrb, krn, "inspect", mrb_obj_inspect, ARGS_NONE()); /* 15.3.1.3.17 */ + mrb_define_method(mrb, krn, "instance_eval", mrb_obj_instance_eval, ARGS_ANY()); /* 15.3.1.3.18 */ + mrb_define_method(mrb, krn, "instance_of?", obj_is_instance_of, ARGS_REQ(1)); /* 15.3.1.3.19 */ + mrb_define_method(mrb, krn, "instance_variable_defined?", mrb_obj_ivar_defined, ARGS_REQ(1)); /* 15.3.1.3.20 */ + mrb_define_method(mrb, krn, "instance_variable_get", mrb_obj_ivar_get, ARGS_REQ(1)); /* 15.3.1.3.21 */ + mrb_define_method(mrb, krn, "instance_variable_set", mrb_obj_ivar_set, ARGS_REQ(2)); /* 15.3.1.3.22 */ + mrb_define_method(mrb, krn, "instance_variables", mrb_obj_instance_variables, ARGS_NONE()); /* 15.3.1.3.23 */ + mrb_define_method(mrb, krn, "is_a?", mrb_obj_is_kind_of_m, ARGS_REQ(1)); /* 15.3.1.3.24 */ + mrb_define_method(mrb, krn, "iterator?", mrb_f_block_given_p_m, ARGS_NONE()); /* 15.3.1.3.25 */ + mrb_define_method(mrb, krn, "kind_of?", mrb_obj_is_kind_of_m, ARGS_REQ(1)); /* 15.3.1.3.26 */ + mrb_define_method(mrb, krn, "methods", mrb_obj_methods_m, ARGS_ANY()); /* 15.3.1.3.31 */ + mrb_define_method(mrb, krn, "nil?", mrb_false, ARGS_NONE()); /* 15.3.1.3.32 */ + mrb_define_method(mrb, krn, "object_id", mrb_obj_id_m, ARGS_NONE()); /* 15.3.1.3.33 */ + mrb_define_method(mrb, krn, "private_methods", mrb_obj_private_methods, ARGS_ANY()); /* 15.3.1.3.36 */ + mrb_define_method(mrb, krn, "protected_methods", mrb_obj_protected_methods, ARGS_ANY()); /* 15.3.1.3.37 */ + mrb_define_method(mrb, krn, "public_methods", mrb_obj_public_methods, ARGS_ANY()); /* 15.3.1.3.38 */ + mrb_define_method(mrb, krn, "raise", mrb_f_raise, ARGS_ANY()); /* 15.3.1.3.40 */ + mrb_define_method(mrb, krn, "remove_instance_variable", mrb_obj_remove_instance_variable,ARGS_REQ(1)); /* 15.3.1.3.41 */ + mrb_define_method(mrb, krn, "respond_to?", obj_respond_to, ARGS_ANY()); /* 15.3.1.3.43 */ + mrb_define_method(mrb, krn, "send", mrb_f_send, ARGS_ANY()); /* 15.3.1.3.44 */ + mrb_define_method(mrb, krn, "singleton_methods", mrb_obj_singleton_methods_m, ARGS_ANY()); /* 15.3.1.3.45 */ + mrb_define_method(mrb, krn, "to_s", mrb_any_to_s, ARGS_NONE()); /* 15.3.1.3.46 */ + +#ifdef ENABLE_SPRINTF + mrb_define_method(mrb, krn, "sprintf", mrb_f_sprintf, ARGS_ANY()); /* in sprintf.c */ + mrb_define_method(mrb, krn, "format", mrb_f_sprintf, ARGS_ANY()); /* in sprintf.c */ +#endif + + mrb_include_module(mrb, mrb->object_class, mrb->kernel_module); + mrb_alias_method(mrb, mrb->module_class, mrb_intern(mrb, "dup"), mrb_intern(mrb, "clone")); +} Added: vendor/mruby-b5830ae/src/keywords (+50 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/keywords 2013-01-09 13:19:18 +0900 (be53248) @@ -0,0 +1,50 @@ +%{ +struct kwtable {const char *name; int id[2]; enum mrb_lex_state_enum state;}; +const struct kwtable *mrb_reserved_word(const char *, unsigned int); +static const struct kwtable *reserved_word(const char *, unsigned int); +#define mrb_reserved_word(str, len) reserved_word(str, len) +%} + +struct kwtable; +%% +__ENCODING__, {keyword__ENCODING__, keyword__ENCODING__}, EXPR_END +__LINE__, {keyword__LINE__, keyword__LINE__}, EXPR_END +__FILE__, {keyword__FILE__, keyword__FILE__}, EXPR_END +BEGIN, {keyword_BEGIN, keyword_BEGIN}, EXPR_END +END, {keyword_END, keyword_END}, EXPR_END +alias, {keyword_alias, keyword_alias}, EXPR_FNAME +and, {keyword_and, keyword_and}, EXPR_VALUE +begin, {keyword_begin, keyword_begin}, EXPR_BEG +break, {keyword_break, keyword_break}, EXPR_MID +case, {keyword_case, keyword_case}, EXPR_VALUE +class, {keyword_class, keyword_class}, EXPR_CLASS +def, {keyword_def, keyword_def}, EXPR_FNAME +do, {keyword_do, keyword_do}, EXPR_BEG +else, {keyword_else, keyword_else}, EXPR_BEG +elsif, {keyword_elsif, keyword_elsif}, EXPR_VALUE +end, {keyword_end, keyword_end}, EXPR_END +ensure, {keyword_ensure, keyword_ensure}, EXPR_BEG +false, {keyword_false, keyword_false}, EXPR_END +for, {keyword_for, keyword_for}, EXPR_VALUE +if, {keyword_if, modifier_if}, EXPR_VALUE +in, {keyword_in, keyword_in}, EXPR_VALUE +module, {keyword_module, keyword_module}, EXPR_VALUE +next, {keyword_next, keyword_next}, EXPR_MID +nil, {keyword_nil, keyword_nil}, EXPR_END +not, {keyword_not, keyword_not}, EXPR_ARG +or, {keyword_or, keyword_or}, EXPR_VALUE +redo, {keyword_redo, keyword_redo}, EXPR_END +rescue, {keyword_rescue, modifier_rescue}, EXPR_MID +retry, {keyword_retry, keyword_retry}, EXPR_END +return, {keyword_return, keyword_return}, EXPR_MID +self, {keyword_self, keyword_self}, EXPR_END +super, {keyword_super, keyword_super}, EXPR_ARG +then, {keyword_then, keyword_then}, EXPR_BEG +true, {keyword_true, keyword_true}, EXPR_END +undef, {keyword_undef, keyword_undef}, EXPR_FNAME +unless, {keyword_unless, modifier_unless}, EXPR_VALUE +until, {keyword_until, modifier_until}, EXPR_VALUE +when, {keyword_when, keyword_when}, EXPR_VALUE +while, {keyword_while, modifier_while}, EXPR_VALUE +yield, {keyword_yield, keyword_yield}, EXPR_ARG +%% Added: vendor/mruby-b5830ae/src/lex.def (+210 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/lex.def 2013-01-09 13:19:18 +0900 (5223aac) @@ -0,0 +1,210 @@ +/* ANSI-C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k'1,3,$' src/keywords */ + +#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 "src/keywords" + +struct kwtable {const char *name; int id[2]; enum mrb_lex_state_enum state;}; +const struct kwtable *mrb_reserved_word(const char *, unsigned int); +static const struct kwtable *reserved_word(const char *, unsigned int); +#define mrb_reserved_word(str, len) reserved_word(str, len) +#line 8 "src/keywords" +struct kwtable; + +#define TOTAL_KEYWORDS 40 +#define MIN_WORD_LENGTH 2 +#define MAX_WORD_LENGTH 12 +#define MIN_HASH_VALUE 8 +#define MAX_HASH_VALUE 50 +/* maximum key range = 43, duplicates = 0 */ + +#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) || defined(__GNUC_STDC_INLINE__) +inline +#elif defined(__GNUC__) +__inline +#endif +static unsigned int +hash (register const char *str, register unsigned int len) +{ + static const unsigned char asso_values[] = + { + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 14, 51, 16, 8, + 11, 13, 51, 51, 51, 51, 10, 51, 13, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 11, 51, 13, 1, 26, + 4, 1, 8, 28, 51, 23, 51, 1, 1, 27, + 5, 19, 21, 51, 8, 3, 3, 11, 51, 21, + 24, 16, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51 + }; + register int hval = len; + + switch (hval) + { + default: + hval += asso_values[(unsigned char)str[2]]; + /*FALLTHROUGH*/ + case 2: + case 1: + hval += asso_values[(unsigned char)str[0]]; + break; + } + return hval + asso_values[(unsigned char)str[len - 1]]; +} + +#ifdef __GNUC__ +__inline +#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +const struct kwtable * +mrb_reserved_word (register const char *str, register unsigned int len) +{ + static const struct kwtable wordlist[] = + { + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 18 "src/keywords" + {"break", {keyword_break, keyword_break}, EXPR_MID}, +#line 23 "src/keywords" + {"else", {keyword_else, keyword_else}, EXPR_BEG}, +#line 33 "src/keywords" + {"nil", {keyword_nil, keyword_nil}, EXPR_END}, +#line 26 "src/keywords" + {"ensure", {keyword_ensure, keyword_ensure}, EXPR_BEG}, +#line 25 "src/keywords" + {"end", {keyword_end, keyword_end}, EXPR_END}, +#line 42 "src/keywords" + {"then", {keyword_then, keyword_then}, EXPR_BEG}, +#line 34 "src/keywords" + {"not", {keyword_not, keyword_not}, EXPR_ARG}, +#line 27 "src/keywords" + {"false", {keyword_false, keyword_false}, EXPR_END}, +#line 40 "src/keywords" + {"self", {keyword_self, keyword_self}, EXPR_END}, +#line 24 "src/keywords" + {"elsif", {keyword_elsif, keyword_elsif}, EXPR_VALUE}, +#line 37 "src/keywords" + {"rescue", {keyword_rescue, modifier_rescue}, EXPR_MID}, +#line 43 "src/keywords" + {"true", {keyword_true, keyword_true}, EXPR_END}, +#line 46 "src/keywords" + {"until", {keyword_until, modifier_until}, EXPR_VALUE}, +#line 45 "src/keywords" + {"unless", {keyword_unless, modifier_unless}, EXPR_VALUE}, +#line 39 "src/keywords" + {"return", {keyword_return, keyword_return}, EXPR_MID}, +#line 21 "src/keywords" + {"def", {keyword_def, keyword_def}, EXPR_FNAME}, +#line 16 "src/keywords" + {"and", {keyword_and, keyword_and}, EXPR_VALUE}, +#line 22 "src/keywords" + {"do", {keyword_do, keyword_do}, EXPR_BEG}, +#line 49 "src/keywords" + {"yield", {keyword_yield, keyword_yield}, EXPR_ARG}, +#line 28 "src/keywords" + {"for", {keyword_for, keyword_for}, EXPR_VALUE}, +#line 44 "src/keywords" + {"undef", {keyword_undef, keyword_undef}, EXPR_FNAME}, +#line 35 "src/keywords" + {"or", {keyword_or, keyword_or}, EXPR_VALUE}, +#line 30 "src/keywords" + {"in", {keyword_in, keyword_in}, EXPR_VALUE}, +#line 47 "src/keywords" + {"when", {keyword_when, keyword_when}, EXPR_VALUE}, +#line 38 "src/keywords" + {"retry", {keyword_retry, keyword_retry}, EXPR_END}, +#line 29 "src/keywords" + {"if", {keyword_if, modifier_if}, EXPR_VALUE}, +#line 19 "src/keywords" + {"case", {keyword_case, keyword_case}, EXPR_VALUE}, +#line 36 "src/keywords" + {"redo", {keyword_redo, keyword_redo}, EXPR_END}, +#line 32 "src/keywords" + {"next", {keyword_next, keyword_next}, EXPR_MID}, +#line 41 "src/keywords" + {"super", {keyword_super, keyword_super}, EXPR_ARG}, +#line 31 "src/keywords" + {"module", {keyword_module, keyword_module}, EXPR_VALUE}, +#line 17 "src/keywords" + {"begin", {keyword_begin, keyword_begin}, EXPR_BEG}, +#line 11 "src/keywords" + {"__LINE__", {keyword__LINE__, keyword__LINE__}, EXPR_END}, +#line 12 "src/keywords" + {"__FILE__", {keyword__FILE__, keyword__FILE__}, EXPR_END}, +#line 10 "src/keywords" + {"__ENCODING__", {keyword__ENCODING__, keyword__ENCODING__}, EXPR_END}, +#line 14 "src/keywords" + {"END", {keyword_END, keyword_END}, EXPR_END}, +#line 15 "src/keywords" + {"alias", {keyword_alias, keyword_alias}, EXPR_FNAME}, +#line 13 "src/keywords" + {"BEGIN", {keyword_BEGIN, keyword_BEGIN}, EXPR_END}, + {""}, +#line 20 "src/keywords" + {"class", {keyword_class, keyword_class}, EXPR_CLASS}, + {""}, {""}, +#line 48 "src/keywords" + {"while", {keyword_while, modifier_while}, EXPR_VALUE} + }; + + 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; +} +#line 50 "src/keywords" + Added: vendor/mruby-b5830ae/src/load.c (+686 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/load.c 2013-01-09 13:19:18 +0900 (2b5f580) @@ -0,0 +1,686 @@ +/* +** load.c - mruby binary loader +** +** See Copyright Notice in mruby.h +*/ + +#include <string.h> +#include "mruby/dump.h" + +#include "mruby/string.h" +#ifdef ENABLE_REGEXP +#include "re.h" +#endif +#include "mruby/proc.h" +#include "mruby/irep.h" + +typedef struct _RiteFILE +{ + FILE* fp; + unsigned char buf[256]; + int cnt; + int readlen; +} RiteFILE; + +const char hex2bin[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //00-0f + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //10-1f + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //20-2f + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, //30-3f + 0, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, //40-4f + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //50-5f + 0, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0 //60-6f + //70-ff +}; + +static uint16_t hex_to_bin8(unsigned char*,unsigned char*); +static uint16_t hex_to_bin16(unsigned char*,unsigned char*); +static uint16_t hex_to_bin32(unsigned char*,unsigned char*); +static uint8_t hex_to_uint8(unsigned char*); +static uint16_t hex_to_uint16(unsigned char*); +static uint32_t hex_to_uint32(unsigned char*); +static char* hex_to_str(char*,char*,uint16_t*); +uint16_t calc_crc_16_ccitt(unsigned char*,int); +static unsigned char rite_fgetcSub(RiteFILE*); +static unsigned char rite_fgetc(RiteFILE*,int); +static unsigned char* rite_fgets(RiteFILE*,unsigned char*,int,int); +static int load_rite_header(FILE*,rite_binary_header*,unsigned char*); +static int load_rite_irep_record(mrb_state*, RiteFILE*,unsigned char*,uint32_t*); +static int read_rite_header(mrb_state*,unsigned char*,rite_binary_header*); +static int read_rite_irep_record(mrb_state*,unsigned char*,uint32_t*); + + +static unsigned char +rite_fgetcSub(RiteFILE* rfp) +{ + //only first call + if (rfp->buf[0] == '\0') { + rfp->readlen = fread(rfp->buf, 1, sizeof(rfp->buf), rfp->fp); + rfp->cnt = 0; + } + + if (rfp->readlen == rfp->cnt) { + rfp->readlen = fread(rfp->buf, 1, sizeof(rfp->buf), rfp->fp); + rfp->cnt = 0; + if (rfp->readlen == 0) { + return '\0'; + } + } + return rfp->buf[(rfp->cnt)++]; +} + +static unsigned char +rite_fgetc(RiteFILE* rfp, int ignorecomment) +{ + unsigned char tmp; + + for (;;) { + tmp = rite_fgetcSub(rfp); + if (tmp == '\n' || tmp == '\r') { + continue; + } + else if (ignorecomment && tmp == '#') { + while (tmp != '\n' && tmp != '\r' && tmp != '\0') + tmp = rite_fgetcSub(rfp); + if (tmp == '\0') + return '\0'; + } + else { + return tmp; + } + } +} + +static unsigned char* +rite_fgets(RiteFILE* rfp, unsigned char* dst, int len, int ignorecomment) +{ + int i; + + for (i=0; i<len; i++) { + if ('\0' == (dst[i] = rite_fgetc(rfp, ignorecomment))) { + return NULL; + } + } + return dst; +} + +static int +load_rite_header(FILE* fp, rite_binary_header* bin_header, unsigned char* hcrc) +{ + rite_file_header file_header; + + if (fread(&file_header, 1, sizeof(file_header), fp) < sizeof(file_header)) { + return MRB_DUMP_READ_FAULT; + } + memcpy(bin_header->rbfi, file_header.rbfi, sizeof(file_header.rbfi)); + if (memcmp(bin_header->rbfi, RITE_FILE_IDENFIFIER, sizeof(bin_header->rbfi)) != 0) { + return MRB_DUMP_INVALID_FILE_HEADER; //File identifier error + } + memcpy(bin_header->rbfv, file_header.rbfv, sizeof(file_header.rbfv)); + if (memcmp(bin_header->rbfv, RITE_FILE_FORMAT_VER, sizeof(bin_header->rbfv)) != 0) { + return MRB_DUMP_INVALID_FILE_HEADER; //File format version error + } + memcpy(bin_header->risv, file_header.risv, sizeof(file_header.risv)); + memcpy(bin_header->rct, file_header.rct, sizeof(file_header.rct)); + memcpy(bin_header->rcv, file_header.rcv, sizeof(file_header.rcv)); + hex_to_bin32(bin_header->rbds, file_header.rbds); + hex_to_bin16(bin_header->nirep, file_header.nirep); + hex_to_bin16(bin_header->sirep, file_header.sirep); + memcpy(bin_header->rsv, file_header.rsv, sizeof(file_header.rsv)); + memcpy(hcrc, file_header.hcrc, sizeof(file_header.hcrc)); + + return MRB_DUMP_OK; +} + +static int +load_rite_irep_record(mrb_state *mrb, RiteFILE* rfp, unsigned char* dst, uint32_t* len) +{ + int i; + uint32_t blocklen; + uint16_t offset, pdl, snl, clen; + unsigned char hex2[2], hex4[4], hex8[8], hcrc[4]; + unsigned char *pStart; + char *char_buf; + uint16_t buf_size =0; + + buf_size = MRB_DUMP_DEFAULT_STR_LEN; + if ((char_buf = (char *)mrb_malloc(mrb, buf_size)) == NULL) + goto error_exit; + + pStart = dst; + + //IREP HEADER BLOCK + *dst = rite_fgetc(rfp, TRUE); //record identifier + if (*dst != RITE_IREP_IDENFIFIER) + return MRB_DUMP_INVALID_IREP; + dst += sizeof(unsigned char); + *dst = rite_fgetc(rfp, TRUE); //class or module + dst += sizeof(unsigned char); + rite_fgets(rfp, hex4, sizeof(hex4), TRUE); //number of local variable + dst += hex_to_bin16(dst, hex4); + rite_fgets(rfp, hex4, sizeof(hex4), TRUE); //number of register variable + dst += hex_to_bin16(dst, hex4); + rite_fgets(rfp, hex4, sizeof(hex4), TRUE); //offset of isec block + offset = hex_to_uint16(hex4); + rite_fgets(rfp, hcrc, sizeof(hcrc), TRUE); //header CRC + memset( char_buf, '\0', buf_size); + rite_fgets(rfp, (unsigned char*)char_buf, (offset - (MRB_DUMP_SIZE_OF_SHORT * RITE_FILE_HEX_SIZE)), TRUE); //class or module name + hex_to_str(char_buf, (char*)(dst + MRB_DUMP_SIZE_OF_SHORT + MRB_DUMP_SIZE_OF_SHORT), &clen); //class or module name + dst += uint16_to_bin((MRB_DUMP_SIZE_OF_SHORT/*crc*/ + clen), (char*)dst); //offset of isec block + dst += hex_to_bin16(dst, hcrc); //header CRC + dst += clen; + + //ISEQ BLOCK + rite_fgets(rfp, hex8, sizeof(hex8), TRUE); //iseq length + dst += hex_to_bin32(dst, hex8); + blocklen = hex_to_uint32(hex8); + for (i=0; i<blocklen; i++) { + rite_fgets(rfp, hex8, sizeof(hex8), TRUE); //iseq + dst += hex_to_bin32(dst, hex8); + } + rite_fgets(rfp, hcrc, sizeof(hcrc), TRUE); //iseq CRC + dst += hex_to_bin16(dst, hcrc); + + //POOL BLOCK + rite_fgets(rfp, hex8, sizeof(hex8), TRUE); //pool length + dst += hex_to_bin32(dst, hex8); + blocklen = hex_to_uint32(hex8); + for (i=0; i<blocklen; i++) { + rite_fgets(rfp, hex2, sizeof(hex2), TRUE); //TT + dst += hex_to_bin8(dst, hex2); + rite_fgets(rfp, hex4, sizeof(hex4), TRUE); //pool data length + pdl = hex_to_uint16(hex4); + + if ( pdl > buf_size - 1) { + buf_size = pdl + 1; + if ((char_buf = (char *)mrb_realloc(mrb, char_buf, buf_size)) == NULL) + goto error_exit; + } + memset(char_buf, '\0', buf_size); + rite_fgets(rfp, (unsigned char*)char_buf, pdl, FALSE); //pool + hex_to_str(char_buf, (char*)(dst + MRB_DUMP_SIZE_OF_SHORT), &clen); + dst += uint16_to_bin(clen, (char*)dst); + dst += clen; + } + rite_fgets(rfp, hcrc, sizeof(hcrc), TRUE); //pool CRC + dst += hex_to_bin16(dst, hcrc); + + //SYMS BLOCK + rite_fgets(rfp, hex8, sizeof(hex8), TRUE); //syms length + dst += hex_to_bin32(dst, hex8); + blocklen = hex_to_uint32(hex8); + for (i=0; i<blocklen; i++) { + rite_fgets(rfp, hex4, sizeof(hex4), TRUE); //symbol name length + snl = hex_to_uint16(hex4); + + if (snl == MRB_DUMP_NULL_SYM_LEN) { + dst += uint16_to_bin(snl, (char*)dst); + continue; + } + + if ( snl > buf_size - 1) { + buf_size = snl + 1; + if ((char_buf = (char *)mrb_realloc(mrb, char_buf, buf_size)) == NULL) + goto error_exit; + } + memset(char_buf, '\0', buf_size); + rite_fgets(rfp, (unsigned char*)char_buf, snl, FALSE); //symbol name + hex_to_str(char_buf, (char*)(dst + MRB_DUMP_SIZE_OF_SHORT), &clen); + dst += uint16_to_bin(clen, (char*)dst); + dst += clen; + } + rite_fgets(rfp, hcrc, sizeof(hcrc), TRUE); //syms CRC + dst += hex_to_bin16(dst, hcrc); + + *len = dst - pStart; + +error_exit: + if (char_buf) + mrb_free(mrb, char_buf); + + return MRB_DUMP_OK; +} + +int +mrb_read_irep_file(mrb_state *mrb, FILE* fp) +{ + int ret, i; + uint32_t len, rlen = 0; + unsigned char hex8[8], hcrc[4]; + unsigned char *dst, *rite_dst = NULL; + rite_binary_header bin_header; + RiteFILE ritefp = { 0 }; + RiteFILE *rfp; + + if ((mrb == NULL) || (fp == NULL)) { + return MRB_DUMP_INVALID_ARGUMENT; + } + ritefp.fp = fp; + rfp = &ritefp; + + //Read File Header Section + if ((ret = load_rite_header(fp, &bin_header, hcrc)) != MRB_DUMP_OK) + return ret; + + len = sizeof(rite_binary_header) + bin_to_uint32(bin_header.rbds); + if ((rite_dst = (unsigned char *)mrb_malloc(mrb, len)) == NULL) + return MRB_DUMP_GENERAL_FAILURE; + + dst = rite_dst; + memset(dst, 0x00, len); + *(rite_binary_header *)dst = bin_header; + dst += sizeof(rite_binary_header); + dst += hex_to_bin16(dst, hcrc); + + //Read Binary Data Section + len = bin_to_uint16(bin_header.nirep); + for (i=0; i<len; i++) { + rite_fgets(rfp, hex8, sizeof(hex8), TRUE); //record len + dst += hex_to_bin32(dst, hex8); + if ((ret = load_rite_irep_record(mrb, rfp, dst, &rlen)) != MRB_DUMP_OK) //irep info + goto error_exit; + dst += rlen; + } + rite_fgets(rfp, hex8, sizeof(hex8), TRUE); //dummy record len + hex_to_bin32(dst, hex8); /* dst += hex_to_bin32(dst, hex8); */ + if (0 != hex_to_uint32(hex8)) { + ret = MRB_DUMP_INVALID_IREP; + goto error_exit; + } + + if (ret == MRB_DUMP_OK) + ret = mrb_read_irep(mrb, (char*)rite_dst); + +error_exit: + if (rite_dst) + mrb_free(mrb, rite_dst); + + return ret; +} + +static int +read_rite_header(mrb_state *mrb, unsigned char *bin, rite_binary_header* bin_header) +{ + uint16_t crc; + + *bin_header = *(rite_binary_header *)bin; + bin += sizeof(rite_binary_header); + if (memcmp(bin_header->rbfi, RITE_FILE_IDENFIFIER, sizeof(bin_header->rbfi)) != 0) { + return MRB_DUMP_INVALID_FILE_HEADER; //File identifier error + } + if (memcmp(bin_header->risv, RITE_VM_VER, sizeof(bin_header->risv)) != 0) { + return MRB_DUMP_INVALID_FILE_HEADER; //Instruction set version check + } + + crc = calc_crc_16_ccitt((unsigned char*)bin_header, sizeof(*bin_header)); //Calculate CRC + if (crc != bin_to_uint16(bin)) { + return MRB_DUMP_INVALID_FILE_HEADER; //CRC error + } + + return bin_to_uint16(bin_header->nirep); +} + +static int +read_rite_irep_record(mrb_state *mrb, unsigned char *src, uint32_t* len) +{ + int i, ret = MRB_DUMP_OK; + char *buf; + unsigned char *recordStart, *pStart; + uint16_t crc, tt, pdl, snl, offset, bufsize=MRB_DUMP_DEFAULT_STR_LEN; + mrb_int fix_num; + mrb_float f; + int plen; + int ai = mrb_gc_arena_save(mrb); + mrb_irep *irep = mrb_add_irep(mrb); + + recordStart = src; + buf = (char *)mrb_malloc(mrb, bufsize); + if (buf == NULL) { + ret = MRB_DUMP_INVALID_IREP; + goto error_exit; + } + + //Header Section + pStart = src; + if (*src != RITE_IREP_IDENFIFIER) + return MRB_DUMP_INVALID_IREP; + src += (sizeof(unsigned char) * 2); + irep->nlocals = bin_to_uint16(src); //number of local variable + src += MRB_DUMP_SIZE_OF_SHORT; + irep->nregs = bin_to_uint16(src); //number of register variable + src += MRB_DUMP_SIZE_OF_SHORT; + offset = bin_to_uint16(src); //offset of isec block + src += MRB_DUMP_SIZE_OF_SHORT; + crc = calc_crc_16_ccitt(pStart, src - pStart); //Calculate CRC + if (crc != bin_to_uint16(src)) //header CRC + return MRB_DUMP_INVALID_IREP; + src += offset; + + //Binary Data Section + //ISEQ BLOCK + pStart = src; + irep->ilen = bin_to_uint32(src); //iseq length + src += MRB_DUMP_SIZE_OF_LONG; + if (irep->ilen > 0) { + if ((irep->iseq = (mrb_code *)mrb_malloc(mrb, sizeof(mrb_code) * irep->ilen)) == NULL) { + ret = MRB_DUMP_GENERAL_FAILURE; + goto error_exit; + } + for (i=0; i<irep->ilen; i++) { + irep->iseq[i] = bin_to_uint32(src); //iseq + src += MRB_DUMP_SIZE_OF_LONG; + } + } + crc = calc_crc_16_ccitt((unsigned char*)pStart, src - pStart); //Calculate CRC + if (crc != bin_to_uint16(src)) { //iseq CRC + ret = MRB_DUMP_INVALID_IREP; + goto error_exit; + } + src += MRB_DUMP_SIZE_OF_SHORT; + + //POOL BLOCK + pStart = src; + plen = bin_to_uint32(src); //pool length + src += MRB_DUMP_SIZE_OF_LONG; + if (plen > 0) { + irep->pool = (mrb_value *)mrb_malloc(mrb, sizeof(mrb_value) * plen); + if (irep->pool == NULL) { + ret = MRB_DUMP_INVALID_IREP; + goto error_exit; + } + + for (i=0; i<plen; i++) { + tt = *src; //pool TT + src += sizeof(unsigned char); + pdl = bin_to_uint16(src); //pool data length + src += MRB_DUMP_SIZE_OF_SHORT; + if (pdl > bufsize - 1) { + mrb_free(mrb, buf); + bufsize = pdl + 1; + if ((buf = (char *)mrb_malloc(mrb, bufsize)) == NULL) { + ret = MRB_DUMP_GENERAL_FAILURE; + goto error_exit; + } + } + memcpy(buf, src, pdl); + src += pdl; + buf[pdl] = '\0'; + + switch (tt) { //pool data + case MRB_TT_FIXNUM: + fix_num = str_to_mrb_int(buf); + irep->pool[i] = mrb_fixnum_value(fix_num); + break; + + case MRB_TT_FLOAT: + f = str_to_mrb_float(buf); + irep->pool[i] = mrb_float_value(f); + break; + + case MRB_TT_STRING: + irep->pool[i] = mrb_str_new(mrb, buf, pdl); + break; + +#ifdef ENABLE_REGEXP + case MRB_TT_REGEX: + str = mrb_str_new(mrb, buf, pdl); + irep->pool[i] = mrb_reg_quote(mrb, str); + break; +#endif + + default: + irep->pool[i] = mrb_nil_value(); + break; + } + irep->plen++; + mrb_gc_arena_restore(mrb, ai); + } + } + crc = calc_crc_16_ccitt((unsigned char*)pStart, src - pStart); //Calculate CRC + if (crc != bin_to_uint16(src)) { //pool CRC + ret = MRB_DUMP_INVALID_IREP; + goto error_exit; + } + src += MRB_DUMP_SIZE_OF_SHORT; + + //SYMS BLOCK + pStart = src; + irep->slen = bin_to_uint32(src); //syms length + src += MRB_DUMP_SIZE_OF_LONG; + if (irep->slen > 0) { + if ((irep->syms = (mrb_sym *)mrb_malloc(mrb, sizeof(mrb_sym) * irep->slen)) == NULL) { + ret = MRB_DUMP_INVALID_IREP; + goto error_exit; + } + + for (i = 0; i < irep->slen; i++) { + static const mrb_sym mrb_sym_zero = { 0 }; + *irep->syms = mrb_sym_zero; + } + for (i=0; i<irep->slen; i++) { + snl = bin_to_uint16(src); //symbol name length + src += MRB_DUMP_SIZE_OF_SHORT; + + if (snl == MRB_DUMP_NULL_SYM_LEN) { + irep->syms[i] = 0; + continue; + } + + if (snl > bufsize - 1) { + mrb_free(mrb, buf); + bufsize = snl + 1; + if ((buf = (char *)mrb_malloc(mrb, bufsize)) == NULL) { + ret = MRB_DUMP_GENERAL_FAILURE; + goto error_exit; + } + } + memcpy(buf, src, snl); //symbol name + src += snl; + buf[snl] = '\0'; + irep->syms[i] = mrb_intern2(mrb, buf, snl); + } + } + crc = calc_crc_16_ccitt((unsigned char*)pStart, src - pStart); //Calculate CRC + if (crc != bin_to_uint16(src)) { //syms CRC + ret = MRB_DUMP_INVALID_IREP; + goto error_exit; + } + src += MRB_DUMP_SIZE_OF_SHORT; + + *len = src - recordStart; +error_exit: + if (buf) + mrb_free(mrb, buf); + + return ret; +} + +int +mrb_read_irep(mrb_state *mrb, const char *bin) +{ + int ret = MRB_DUMP_OK, i, n, nirep, sirep; + uint32_t len = 0; + unsigned char *src; + rite_binary_header bin_header; + + if ((mrb == NULL) || (bin == NULL)) { + return MRB_DUMP_INVALID_ARGUMENT; + } + src = (unsigned char*)bin; + sirep = mrb->irep_len; + + //Read File Header Section + if ((nirep = read_rite_header(mrb, src, &bin_header)) < 0) + return nirep; + + src += sizeof(bin_header) + MRB_DUMP_SIZE_OF_SHORT; //header + crc + + //Read Binary Data Section + for (n=0,i=sirep; n<nirep; n++,i++) { + src += MRB_DUMP_SIZE_OF_LONG; //record ren + if ((ret = read_rite_irep_record(mrb, src, &len)) != MRB_DUMP_OK) + goto error_exit; + src += len; + } + if (0 != bin_to_uint32(src)) { //dummy record len + ret = MRB_DUMP_GENERAL_FAILURE; + } + +error_exit: + if (ret != MRB_DUMP_OK) { + for (n=0,i=sirep; i<mrb->irep_len; n++,i++) { + if (mrb->irep[i]) { + if (mrb->irep[i]->iseq) + mrb_free(mrb, mrb->irep[i]->iseq); + + if (mrb->irep[i]->pool) + mrb_free(mrb, mrb->irep[i]->pool); + + if (mrb->irep[i]->syms) + mrb_free(mrb, mrb->irep[i]->syms); + + mrb_free(mrb, mrb->irep[i]); + } + } + // mrb->irep_len = sirep; + return ret; + } + return sirep + hex_to_uint8(bin_header.sirep); +} + +static uint16_t +hex_to_bin8(unsigned char *dst, unsigned char *src) +{ + dst[0] = (hex2bin[src[0]] << 4) | (hex2bin[src[1]]); + return 1; +} + +static uint16_t +hex_to_bin16(unsigned char *dst, unsigned char *src) +{ + dst[0] = (hex2bin[src[0]] << 4) | (hex2bin[src[1]]); + dst[1] = (hex2bin[src[2]] << 4) | (hex2bin[src[3]]); + return 2; +} + +static uint16_t +hex_to_bin32(unsigned char *dst, unsigned char *src) +{ + dst[0] = (hex2bin[src[0]] << 4) | (hex2bin[src[1]]); + dst[1] = (hex2bin[src[2]] << 4) | (hex2bin[src[3]]); + dst[2] = (hex2bin[src[4]] << 4) | (hex2bin[src[5]]); + dst[3] = (hex2bin[src[6]] << 4) | (hex2bin[src[7]]); + return 4; +} + +static uint8_t +hex_to_uint8(unsigned char *hex) +{ + return (unsigned char)hex2bin[hex[0]] << 4 | + (unsigned char)hex2bin[hex[1]]; +} + +static uint16_t +hex_to_uint16(unsigned char *hex) +{ + return (uint16_t)hex2bin[hex[0]] << 12 | + (uint16_t)hex2bin[hex[1]] << 8 | + (uint16_t)hex2bin[hex[2]] << 4 | + (uint16_t)hex2bin[hex[3]]; +} + +static uint32_t +hex_to_uint32(unsigned char *hex) +{ + return (uint32_t)hex2bin[hex[0]] << 28 | + (uint32_t)hex2bin[hex[1]] << 24 | + (uint32_t)hex2bin[hex[2]] << 20 | + (uint32_t)hex2bin[hex[3]] << 16 | + (uint32_t)hex2bin[hex[4]] << 12 | + (uint32_t)hex2bin[hex[5]] << 8 | + (uint32_t)hex2bin[hex[6]] << 4 | + (uint32_t)hex2bin[hex[7]]; +} + +static char* +hex_to_str(char *hex, char *str, uint16_t *str_len) +{ + char *src, *dst, buf[4]; + int escape = 0, base = 0; + char *err_ptr; + + *str_len = 0; + for (src = hex, dst = str; *src != '\0'; src++) { + if (escape) { + switch(*src) { + case 'a': *dst++ = '\a'/* BEL */; break; + case 'b': *dst++ = '\b'/* BS */; break; + case 't': *dst++ = '\t'/* HT */; break; + case 'n': *dst++ = '\n'/* LF */; break; + case 'v': *dst++ = '\v'/* VT */; break; + case 'f': *dst++ = '\f'/* FF */; break; + case 'r': *dst++ = '\r'/* CR */; break; + case '\"': /* fall through */ + case '\'': /* fall through */ + case '\?': /* fall through */ + case '\\': *dst++ = *src; break; + default: + if (*src >= '0' && *src <= '7') { + base = 8; + strncpy(buf, src, 3); + } else if (*src == 'x' || *src == 'X') { + base = 16; + src++; + strncpy(buf, src, 2); + } + + *dst++ = (unsigned char) strtol(buf, &err_ptr, base) & 0xff; + src += (err_ptr - buf - 1); + break; + } + escape = 0; + } else { + if (*src == '\\') { + escape = 1; + } else { + escape = 0; + *dst++ = *src; + } + } + if (!escape) { + (*str_len)++; + } + } + return str; +} + +static void +irep_error(mrb_state *mrb, int n) +{ + static const char msg[] = "irep load error"; + mrb->exc = (struct RObject*)mrb_object(mrb_exc_new(mrb, E_SCRIPT_ERROR, msg, sizeof(msg) - 1)); +} + +mrb_value +mrb_load_irep_file(mrb_state *mrb, FILE* fp) +{ + int n = mrb_read_irep_file(mrb, fp); + + if (n < 0) { + irep_error(mrb, n); + return mrb_nil_value(); + } + return mrb_run(mrb, mrb_proc_new(mrb, mrb->irep[n]), mrb_top_self(mrb)); +} + +mrb_value +mrb_load_irep(mrb_state *mrb, const char *bin) +{ + int n = mrb_read_irep(mrb, bin); + + if (n < 0) { + irep_error(mrb, n); + return mrb_nil_value(); + } + return mrb_run(mrb, mrb_proc_new(mrb, mrb->irep[n]), mrb_top_self(mrb)); +} Added: vendor/mruby-b5830ae/src/math.c (+688 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/math.c 2013-01-09 13:19:18 +0900 (3e45509) @@ -0,0 +1,688 @@ +/* +** math.c - Math module +** +** See Copyright Notice in mruby.h +*/ + +#include "mruby.h" +#include "mruby/array.h" + +#ifdef ENABLE_MATH +#include <math.h> + +#define domain_error(msg) \ + mrb_raise(mrb, E_RANGE_ERROR, "Numerical argument is out of domain - " #msg); + +/* math functions not provided under Microsoft Visual C++ */ +#ifdef _MSC_VER + +#define MATH_TOLERANCE 1E-12 + +#define asinh(x) log(x + sqrt(pow(x,2.0) + 1)) +#define acosh(x) log(x + sqrt(pow(x,2.0) - 1)) +#define atanh(x) (log(1+x) - log(1-x))/2.0 +#define cbrt(x) pow(x,1.0/3.0) + +/* Declaration of complementary Error function */ +double +erfc(double x); + +/* +** Implementations of error functions +** credits to http://www.digitalmars.com/archives/cplusplus/3634.html +*/ + +/* Implementation of Error function */ +double +erf(double x) +{ + static const double two_sqrtpi = 1.128379167095512574; + double sum = x; + double term = x; + double xsqr = x*x; + int j= 1; + if (fabs(x) > 2.2) { + return 1.0 - erfc(x); + } + do { + term *= xsqr/j; + sum -= term/(2*j+1); + ++j; + term *= xsqr/j; + sum += term/(2*j+1); + ++j; + } while (fabs(term/sum) > MATH_TOLERANCE); + return two_sqrtpi*sum; +} + +/* Implementation of complementary Error function */ +double +erfc(double x) +{ + static const double one_sqrtpi= 0.564189583547756287; + double a = 1; + double b = x; + double c = x; + double d = x*x+0.5; + double q1; + double q2 = b/d; + double n = 1.0; + double t; + if (fabs(x) < 2.2) { + return 1.0 - erf(x); + } + if (x < 0.0) { /*signbit(x)*/ + return 2.0 - erfc(-x); + } + do { + t = a*n+b*x; + a = b; + b = t; + t = c*n+d*x; + c = d; + d = t; + n += 0.5; + q1 = q2; + q2 = b/d; + } while (fabs(q1-q2)/q2 > MATH_TOLERANCE); + return one_sqrtpi*exp(-x*x)*q2; +} + +#endif + +/* + TRIGONOMETRIC FUNCTIONS +*/ + +/* + * call-seq: + * Math.sin(x) -> float + * + * Computes the sine of <i>x</i> (expressed in radians). Returns + * -1..1. + */ +static mrb_value +math_sin(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = sin(x); + + return mrb_float_value(x); +} + +/* + * call-seq: + * Math.cos(x) -> float + * + * Computes the cosine of <i>x</i> (expressed in radians). Returns + * -1..1. + */ +static mrb_value +math_cos(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = cos(x); + + return mrb_float_value(x); +} + +/* + * call-seq: + * Math.tan(x) -> float + * + * Returns the tangent of <i>x</i> (expressed in radians). + */ +static mrb_value +math_tan(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = tan(x); + + return mrb_float_value(x); +} + +/* + INVERSE TRIGONOMETRIC FUNCTIONS +*/ + +/* + * call-seq: + * Math.asin(x) -> float + * + * Computes the arc sine of <i>x</i>. Returns -{PI/2} .. {PI/2}. + */ +static mrb_value +math_asin(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = asin(x); + + return mrb_float_value(x); +} + +/* + * call-seq: + * Math.acos(x) -> float + * + * Computes the arc cosine of <i>x</i>. Returns 0..PI. + */ +static mrb_value +math_acos(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = acos(x); + + return mrb_float_value(x); +} + +/* + * call-seq: + * Math.atan(x) -> float + * + * Computes the arc tangent of <i>x</i>. Returns -{PI/2} .. {PI/2}. + */ +static mrb_value +math_atan(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = atan(x); + + return mrb_float_value(x); +} + +/* + * call-seq: + * Math.atan2(y, x) -> float + * + * Computes the arc tangent given <i>y</i> and <i>x</i>. Returns + * -PI..PI. + * + * Math.atan2(-0.0, -1.0) #=> -3.141592653589793 + * Math.atan2(-1.0, -1.0) #=> -2.356194490192345 + * Math.atan2(-1.0, 0.0) #=> -1.5707963267948966 + * Math.atan2(-1.0, 1.0) #=> -0.7853981633974483 + * Math.atan2(-0.0, 1.0) #=> -0.0 + * Math.atan2(0.0, 1.0) #=> 0.0 + * Math.atan2(1.0, 1.0) #=> 0.7853981633974483 + * Math.atan2(1.0, 0.0) #=> 1.5707963267948966 + * Math.atan2(1.0, -1.0) #=> 2.356194490192345 + * Math.atan2(0.0, -1.0) #=> 3.141592653589793 + * + */ +static mrb_value +math_atan2(mrb_state *mrb, mrb_value obj) +{ + mrb_float x, y; + + mrb_get_args(mrb, "ff", &x, &y); + x = atan2(x, y); + + return mrb_float_value(x); +} + + + +/* + HYPERBOLIC TRIG FUNCTIONS +*/ +/* + * call-seq: + * Math.sinh(x) -> float + * + * Computes the hyperbolic sine of <i>x</i> (expressed in + * radians). + */ +static mrb_value +math_sinh(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = sinh(x); + + return mrb_float_value(x); +} + +/* + * call-seq: + * Math.cosh(x) -> float + * + * Computes the hyperbolic cosine of <i>x</i> (expressed in radians). + */ +static mrb_value +math_cosh(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = cosh(x); + + return mrb_float_value(x); +} + +/* + * call-seq: + * Math.tanh() -> float + * + * Computes the hyperbolic tangent of <i>x</i> (expressed in + * radians). + */ +static mrb_value +math_tanh(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = tanh(x); + + return mrb_float_value(x); +} + + +/* + INVERSE HYPERBOLIC TRIG FUNCTIONS +*/ + +/* + * call-seq: + * Math.asinh(x) -> float + * + * Computes the inverse hyperbolic sine of <i>x</i>. + */ +static mrb_value +math_asinh(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + + x = asinh(x); + + return mrb_float_value(x); +} + +/* + * call-seq: + * Math.acosh(x) -> float + * + * Computes the inverse hyperbolic cosine of <i>x</i>. + */ +static mrb_value +math_acosh(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = acosh(x); + + return mrb_float_value(x); +} + +/* + * call-seq: + * Math.atanh(x) -> float + * + * Computes the inverse hyperbolic tangent of <i>x</i>. + */ +static mrb_value +math_atanh(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = atanh(x); + + return mrb_float_value(x); +} + +/* + EXPONENTIALS AND LOGARITHMS +*/ +#if defined __CYGWIN__ +# include <cygwin/version.h> +# if CYGWIN_VERSION_DLL_MAJOR < 1005 +# define nan(x) nan() +# endif +# define log(x) ((x) < 0.0 ? nan("") : log(x)) +# define log10(x) ((x) < 0.0 ? nan("") : log10(x)) +#endif + +#ifndef log2 +#ifndef HAVE_LOG2 +double +log2(double x) +{ + return log10(x)/log10(2.0); +} +#else +extern double log2(double); +#endif +#endif + +/* + * call-seq: + * Math.exp(x) -> float + * + * Returns e**x. + * + * Math.exp(0) #=> 1.0 + * Math.exp(1) #=> 2.718281828459045 + * Math.exp(1.5) #=> 4.4816890703380645 + * + */ +static mrb_value +math_exp(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = exp(x); + + return mrb_float_value(x); +} + +/* + * call-seq: + * Math.log(numeric) -> float + * Math.log(num,base) -> float + * + * Returns the natural logarithm of <i>numeric</i>. + * If additional second argument is given, it will be the base + * of logarithm. + * + * Math.log(1) #=> 0.0 + * Math.log(Math::E) #=> 1.0 + * Math.log(Math::E**3) #=> 3.0 + * Math.log(12,3) #=> 2.2618595071429146 + * + */ +static mrb_value +math_log(mrb_state *mrb, mrb_value obj) +{ + mrb_float x, base; + int argc; + + argc = mrb_get_args(mrb, "f|f", &x, &base); + x = log(x); + if (argc == 2) { + x /= log(base); + } + return mrb_float_value(x); +} + +/* + * call-seq: + * Math.log2(numeric) -> float + * + * Returns the base 2 logarithm of <i>numeric</i>. + * + * Math.log2(1) #=> 0.0 + * Math.log2(2) #=> 1.0 + * Math.log2(32768) #=> 15.0 + * Math.log2(65536) #=> 16.0 + * + */ +static mrb_value +math_log2(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = log2(x); + + return mrb_float_value(x); +} + +/* + * call-seq: + * Math.log10(numeric) -> float + * + * Returns the base 10 logarithm of <i>numeric</i>. + * + * Math.log10(1) #=> 0.0 + * Math.log10(10) #=> 1.0 + * Math.log10(10**100) #=> 100.0 + * + */ +static mrb_value +math_log10(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = log10(x); + + return mrb_float_value(x); +} + +/* + * call-seq: + * Math.sqrt(numeric) -> float + * + * Returns the square root of <i>numeric</i>. + * + */ +static mrb_value +math_sqrt(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = sqrt(x); + + return mrb_float_value(x); +} + + +/* + * call-seq: + * Math.cbrt(numeric) -> float + * + * Returns the cube root of <i>numeric</i>. + * + * -9.upto(9) {|x| + * p [x, Math.cbrt(x), Math.cbrt(x)**3] + * } + * #=> + * [-9, -2.0800838230519, -9.0] + * [-8, -2.0, -8.0] + * [-7, -1.91293118277239, -7.0] + * [-6, -1.81712059283214, -6.0] + * [-5, -1.7099759466767, -5.0] + * [-4, -1.5874010519682, -4.0] + * [-3, -1.44224957030741, -3.0] + * [-2, -1.25992104989487, -2.0] + * [-1, -1.0, -1.0] + * [0, 0.0, 0.0] + * [1, 1.0, 1.0] + * [2, 1.25992104989487, 2.0] + * [3, 1.44224957030741, 3.0] + * [4, 1.5874010519682, 4.0] + * [5, 1.7099759466767, 5.0] + * [6, 1.81712059283214, 6.0] + * [7, 1.91293118277239, 7.0] + * [8, 2.0, 8.0] + * [9, 2.0800838230519, 9.0] + * + */ +static mrb_value +math_cbrt(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = cbrt(x); + + return mrb_float_value(x); +} + + +/* + * call-seq: + * Math.frexp(numeric) -> [ fraction, exponent ] + * + * Returns a two-element array containing the normalized fraction (a + * <code>Float</code>) and exponent (a <code>Fixnum</code>) of + * <i>numeric</i>. + * + * fraction, exponent = Math.frexp(1234) #=> [0.6025390625, 11] + * fraction * 2**exponent #=> 1234.0 + */ +static mrb_value +math_frexp(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + int exp; + + mrb_get_args(mrb, "f", &x); + x = frexp(x, &exp); + + return mrb_assoc_new(mrb, mrb_float_value(x), mrb_fixnum_value(exp)); +} + +/* + * call-seq: + * Math.ldexp(flt, int) -> float + * + * Returns the value of <i>flt</i>*(2**<i>int</i>). + * + * fraction, exponent = Math.frexp(1234) + * Math.ldexp(fraction, exponent) #=> 1234.0 + */ +static mrb_value +math_ldexp(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + mrb_int i; + + mrb_get_args(mrb, "fi", &x, &i); + x = ldexp(x, i); + + return mrb_float_value(x); +} + +/* + * call-seq: + * Math.hypot(x, y) -> float + * + * Returns sqrt(x**2 + y**2), the hypotenuse of a right-angled triangle + * with sides <i>x</i> and <i>y</i>. + * + * Math.hypot(3, 4) #=> 5.0 + */ +static mrb_value +math_hypot(mrb_state *mrb, mrb_value obj) +{ + mrb_float x, y; + + mrb_get_args(mrb, "ff", &x, &y); + x = hypot(x, y); + + return mrb_float_value(x); +} + +/* + * call-seq: + * Math.erf(x) -> float + * + * Calculates the error function of x. + */ +static mrb_value +math_erf(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = erf(x); + + return mrb_float_value(x); +} + + +/* + * call-seq: + * Math.erfc(x) -> float + * + * Calculates the complementary error function of x. + */ +static mrb_value +math_erfc(mrb_state *mrb, mrb_value obj) +{ + mrb_float x; + + mrb_get_args(mrb, "f", &x); + x = erfc(x); + + return mrb_float_value(x); +} + +/* ------------------------------------------------------------------------*/ +void +mrb_init_math(mrb_state *mrb) +{ + struct RClass *mrb_math; + mrb_math = mrb_define_module(mrb, "Math"); + +#ifdef M_PI + mrb_define_const(mrb, mrb_math, "PI", mrb_float_value(M_PI)); +#else + mrb_define_const(mrb, mrb_math, "PI", mrb_float_value(atan(1.0)*4.0)); +#endif + +#ifdef M_E + mrb_define_const(mrb, mrb_math, "E", mrb_float_value(M_E)); +#else + mrb_define_const(mrb, mrb_math, "E", mrb_float_value(exp(1.0))); +#endif + +#ifdef MRB_USE_FLOAT + mrb_define_const(mrb, mrb_math, "TOLERANCE", mrb_float_value(1e-5)); +#else + mrb_define_const(mrb, mrb_math, "TOLERANCE", mrb_float_value(1e-12)); +#endif + + mrb_define_module_function(mrb, mrb_math, "sin", math_sin, ARGS_REQ(1)); + mrb_define_module_function(mrb, mrb_math, "cos", math_cos, ARGS_REQ(1)); + mrb_define_module_function(mrb, mrb_math, "tan", math_tan, ARGS_REQ(1)); + + mrb_define_module_function(mrb, mrb_math, "asin", math_asin, ARGS_REQ(1)); + mrb_define_module_function(mrb, mrb_math, "acos", math_acos, ARGS_REQ(1)); + mrb_define_module_function(mrb, mrb_math, "atan", math_atan, ARGS_REQ(1)); + mrb_define_module_function(mrb, mrb_math, "atan2", math_atan2, ARGS_REQ(2)); + + mrb_define_module_function(mrb, mrb_math, "sinh", math_sinh, ARGS_REQ(1)); + mrb_define_module_function(mrb, mrb_math, "cosh", math_cosh, ARGS_REQ(1)); + mrb_define_module_function(mrb, mrb_math, "tanh", math_tanh, ARGS_REQ(1)); + + mrb_define_module_function(mrb, mrb_math, "asinh", math_asinh, ARGS_REQ(1)); + mrb_define_module_function(mrb, mrb_math, "acosh", math_acosh, ARGS_REQ(1)); + mrb_define_module_function(mrb, mrb_math, "atanh", math_atanh, ARGS_REQ(1)); + + mrb_define_module_function(mrb, mrb_math, "exp", math_exp, ARGS_REQ(1)); + mrb_define_module_function(mrb, mrb_math, "log", math_log, ARGS_REQ(1)|ARGS_OPT(1)); + mrb_define_module_function(mrb, mrb_math, "log2", math_log2, ARGS_REQ(1)); + mrb_define_module_function(mrb, mrb_math, "log10", math_log10, ARGS_REQ(1)); + mrb_define_module_function(mrb, mrb_math, "sqrt", math_sqrt, ARGS_REQ(1)); + mrb_define_module_function(mrb, mrb_math, "cbrt", math_cbrt, ARGS_REQ(1)); + + mrb_define_module_function(mrb, mrb_math, "frexp", math_frexp, ARGS_REQ(1)); + mrb_define_module_function(mrb, mrb_math, "ldexp", math_ldexp, ARGS_REQ(2)); + + mrb_define_module_function(mrb, mrb_math, "hypot", math_hypot, ARGS_REQ(2)); + + mrb_define_module_function(mrb, mrb_math, "erf", math_erf, ARGS_REQ(1)); + mrb_define_module_function(mrb, mrb_math, "erfc", math_erfc, ARGS_REQ(1)); +} +#endif /* ENABLE_MATH */ Added: vendor/mruby-b5830ae/src/mrblib.c (+1074 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/mrblib.c 2013-01-09 13:19:18 +0900 (2c3deea) @@ -0,0 +1,1074 @@ +#include "mruby.h" +#include "mruby/irep.h" +#include "mruby/dump.h" +#include "mruby/string.h" +#include "mruby/proc.h" + +extern const char mrblib_irep[]; + +void +mrb_init_mrblib(mrb_state *mrb) +{ + mrb_load_irep(mrb, mrblib_irep); +} + +const char mrblib_irep[] = { +0x52,0x49,0x54,0x45,0x30,0x30,0x30,0x39,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x39, +0x30,0x30,0x30,0x30,0x4d,0x41,0x54,0x5a,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x39, +0x30,0x30,0x30,0x30,0x00,0x00,0x42,0x18,0x00,0x94,0x00,0x00,0x20,0x20,0x20,0x20, +0x20,0x20,0x20,0x20,0xf5,0x11,0x00,0x00,0x03,0x5f,0x53,0x43,0x00,0x01,0x00,0x03, +0x00,0x02,0x46,0x9f,0x00,0x00,0x00,0x83,0x00,0x80,0x00,0x05,0x01,0x00,0x00,0x05, +0x00,0x80,0x00,0x43,0x00,0x80,0x00,0xc5,0x00,0x80,0x00,0x05,0x01,0x00,0x00,0x91, +0x00,0x80,0x80,0x43,0x00,0x80,0x01,0xc5,0x00,0x80,0x00,0x05,0x01,0x00,0x00,0x91, +0x00,0x80,0xc0,0x43,0x00,0x80,0x02,0x45,0x00,0x80,0x00,0x05,0x01,0x00,0x00,0x91, +0x00,0x81,0x00,0x43,0x00,0x80,0x02,0xc5,0x00,0x80,0x00,0x05,0x01,0x00,0x02,0x11, +0x00,0x81,0x40,0x43,0x00,0x80,0x03,0x45,0x00,0x80,0x00,0x05,0x01,0x00,0x00,0x91, +0x00,0x81,0x80,0x43,0x00,0x80,0x03,0xc5,0x00,0x80,0x00,0x05,0x01,0x00,0x00,0x91, +0x00,0x81,0xc0,0x43,0x00,0x80,0x04,0x45,0x00,0x80,0x00,0x05,0x01,0x00,0x00,0x91, +0x00,0x82,0x00,0x43,0x00,0x80,0x04,0xc5,0x00,0x80,0x00,0x05,0x01,0x00,0x04,0x11, +0x00,0x82,0x40,0x43,0x00,0x80,0x05,0x45,0x00,0x80,0x00,0x05,0x01,0x00,0x00,0x91, +0x00,0x82,0x80,0x43,0x00,0x80,0x05,0xc5,0x00,0x80,0x00,0x05,0x01,0x00,0x05,0x11, +0x00,0x82,0xc0,0x43,0x00,0x80,0x06,0x45,0x00,0x80,0x00,0x05,0x01,0x00,0x06,0x11, +0x00,0x83,0x40,0x43,0x00,0x80,0x06,0xc5,0x00,0x80,0x00,0x05,0x00,0x83,0x80,0x44, +0x00,0x80,0x07,0x45,0x00,0x80,0x00,0x05,0x00,0x83,0xc0,0x44,0x00,0x80,0x19,0x45, +0x00,0x80,0x08,0x11,0x01,0x00,0x09,0x04,0x00,0x84,0x40,0xa0,0x00,0xc0,0x02,0x19, +0x00,0x80,0x00,0x05,0x01,0x00,0x00,0x05,0x00,0x84,0x80,0x43,0x00,0x80,0x1e,0xc5, +0x00,0x80,0x00,0x05,0x01,0x00,0x00,0x05,0x00,0x84,0xc0,0x43,0x00,0x80,0x22,0x45, +0x00,0x80,0x00,0x05,0x00,0x85,0x00,0x44,0x00,0x80,0x27,0x45,0x00,0x80,0x00,0x05, +0x01,0x00,0x00,0x05,0x00,0x84,0xc0,0x43,0x00,0x80,0x27,0xc5,0x00,0x80,0x00,0x05, +0x01,0x00,0x00,0x05,0x00,0x85,0x40,0x43,0x00,0x80,0x28,0x45,0x00,0x80,0x00,0x05, +0x01,0x00,0x00,0x05,0x00,0x85,0x80,0x43,0x00,0x80,0x2c,0xc5,0x00,0x80,0x00,0x05, +0x00,0x83,0x80,0x44,0x00,0x80,0x2d,0xc5,0x00,0x80,0x00,0x05,0x01,0x00,0x00,0x05, +0x00,0x85,0x80,0x43,0x00,0x80,0x2e,0x45,0x00,0x80,0x00,0x05,0x01,0x00,0x00,0x05, +0x00,0x85,0xc0,0x43,0x00,0x80,0x2e,0xc5,0x00,0x80,0x00,0x05,0x00,0x85,0x00,0x44, +0x00,0x80,0x31,0x45,0x00,0x80,0x00,0x05,0x01,0x00,0x00,0x05,0x00,0x86,0x00,0x43, +0x00,0x80,0x31,0xc5,0x00,0x80,0x00,0x05,0x00,0x85,0x00,0x44,0x00,0x80,0x32,0x45, +0x00,0x80,0x00,0x05,0x01,0x00,0x00,0x05,0x00,0x86,0x40,0x43,0x00,0x80,0x35,0xc5, +0x00,0x80,0x00,0x05,0x00,0x83,0x80,0x44,0x00,0x80,0x41,0x45,0x00,0x80,0x00,0x05, +0x01,0x00,0x00,0x05,0x00,0x86,0x40,0x43,0x00,0x80,0x41,0xc5,0x00,0x80,0x00,0x05, +0x00,0x83,0xc0,0x44,0x00,0x80,0x42,0x45,0x00,0x80,0x00,0x05,0x01,0x00,0x00,0x05, +0x00,0x86,0x80,0x43,0x00,0x80,0x44,0xc5,0x00,0x80,0x00,0x05,0x00,0x83,0x80,0x44, +0x00,0x80,0x48,0x45,0x00,0x80,0x00,0x05,0x00,0x85,0x00,0x44,0x00,0x80,0x48,0xc5, +0x00,0x80,0x00,0x05,0x01,0x00,0x00,0x05,0x00,0x86,0x80,0x43,0x00,0x80,0x49,0x45, +0x00,0x00,0x00,0x4a,0x0f,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1b, +0x00,0x09,0x45,0x78,0x63,0x65,0x70,0x74,0x69,0x6f,0x6e,0x00,0x0d,0x53,0x74,0x61, +0x6e,0x64,0x61,0x72,0x64,0x45,0x72,0x72,0x6f,0x72,0x00,0x0d,0x41,0x72,0x67,0x75, +0x6d,0x65,0x6e,0x74,0x45,0x72,0x72,0x6f,0x72,0x00,0x0e,0x4c,0x6f,0x63,0x61,0x6c, +0x4a,0x75,0x6d,0x70,0x45,0x72,0x72,0x6f,0x72,0x00,0x0a,0x52,0x61,0x6e,0x67,0x65, +0x45,0x72,0x72,0x6f,0x72,0x00,0x10,0x46,0x6c,0x6f,0x61,0x74,0x44,0x6f,0x6d,0x61, +0x69,0x6e,0x45,0x72,0x72,0x6f,0x72,0x00,0x0b,0x52,0x65,0x67,0x65,0x78,0x70,0x45, +0x72,0x72,0x6f,0x72,0x00,0x09,0x54,0x79,0x70,0x65,0x45,0x72,0x72,0x6f,0x72,0x00, +0x09,0x4e,0x61,0x6d,0x65,0x45,0x72,0x72,0x6f,0x72,0x00,0x0d,0x4e,0x6f,0x4d,0x65, +0x74,0x68,0x6f,0x64,0x45,0x72,0x72,0x6f,0x72,0x00,0x0a,0x49,0x6e,0x64,0x65,0x78, +0x45,0x72,0x72,0x6f,0x72,0x00,0x08,0x4b,0x65,0x79,0x45,0x72,0x72,0x6f,0x72,0x00, +0x0b,0x53,0x63,0x72,0x69,0x70,0x74,0x45,0x72,0x72,0x6f,0x72,0x00,0x13,0x4e,0x6f, +0x74,0x49,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x65,0x64,0x45,0x72,0x72,0x6f, +0x72,0x00,0x0a,0x45,0x6e,0x75,0x6d,0x65,0x72,0x61,0x62,0x6c,0x65,0x00,0x06,0x4b, +0x65,0x72,0x6e,0x65,0x6c,0x00,0x06,0x4f,0x62,0x6a,0x65,0x63,0x74,0x00,0x0e,0x63, +0x6f,0x6e,0x73,0x74,0x5f,0x64,0x65,0x66,0x69,0x6e,0x65,0x64,0x3f,0x00,0x06,0x53, +0x74,0x72,0x75,0x63,0x74,0x00,0x06,0x53,0x74,0x72,0x69,0x6e,0x67,0x00,0x0a,0x43, +0x6f,0x6d,0x70,0x61,0x72,0x61,0x62,0x6c,0x65,0x00,0x06,0x4d,0x6f,0x64,0x75,0x6c, +0x65,0x00,0x05,0x52,0x61,0x6e,0x67,0x65,0x00,0x07,0x49,0x6e,0x74,0x65,0x67,0x65, +0x72,0x00,0x07,0x4e,0x75,0x6d,0x65,0x72,0x69,0x63,0x00,0x04,0x48,0x61,0x73,0x68, +0x00,0x05,0x41,0x72,0x72,0x61,0x79,0xb5,0xf3,0x00,0x00,0x00,0x3f,0x53,0x43,0x00, +0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00,0x00,0x00,0x06,0x00,0x80,0x00,0x06,0x00, +0x80,0x40,0x47,0x01,0x00,0x02,0xc0,0x00,0x80,0x00,0x46,0x00,0x00,0x00,0x05,0x00, +0x00,0x00,0x29,0x2a,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, +0x09,0x65,0x78,0x63,0x65,0x70,0x74,0x69,0x6f,0x6e,0x28,0xc2,0x00,0x00,0x00,0x41, +0x53,0x43,0x00,0x03,0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x08,0x00,0x08, +0x00,0xa6,0x01,0x80,0x00,0x06,0x02,0x01,0x00,0x37,0x02,0x80,0x40,0x01,0x02,0x01, +0x40,0x38,0x02,0x80,0x80,0x01,0x01,0x80,0x3f,0xa1,0x01,0x80,0x00,0x29,0xfd,0x47, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x03,0x6e,0x65,0x77,0xcb, +0xf8,0x00,0x00,0x00,0x24,0x53,0x43,0x00,0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00, +0x00,0x00,0x02,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x29,0x8b,0x3a,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x53,0x43,0x00, +0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x05,0x00, +0x00,0x00,0x29,0x8b,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x24,0x53,0x43,0x00,0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00, +0x00,0x00,0x02,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x29,0x8b,0x3a,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x53,0x43,0x00, +0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x05,0x00, +0x00,0x00,0x29,0x8b,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x24,0x53,0x43,0x00,0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00, +0x00,0x00,0x02,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x29,0x8b,0x3a,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x53,0x43,0x00, +0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x05,0x00, +0x00,0x00,0x29,0x8b,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x24,0x53,0x43,0x00,0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00, +0x00,0x00,0x02,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x29,0x8b,0x3a,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x53,0x43,0x00, +0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x05,0x00, +0x00,0x00,0x29,0x8b,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x24,0x53,0x43,0x00,0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00, +0x00,0x00,0x02,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x29,0x8b,0x3a,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x53,0x43,0x00, +0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x05,0x00, +0x00,0x00,0x29,0x8b,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x24,0x53,0x43,0x00,0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00, +0x00,0x00,0x02,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x29,0x8b,0x3a,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x1a,0x53,0x43,0x00, +0x01,0x00,0x04,0x00,0x02,0x36,0x78,0x00,0x00,0x00,0x4f,0x00,0x80,0x00,0x48,0x01, +0x00,0x02,0xc0,0x00,0x80,0x00,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x08,0xc0,0x00, +0x80,0x40,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x0e,0xc0,0x00,0x80,0x80,0x46,0x00, +0x80,0x00,0x48,0x01,0x00,0x12,0xc0,0x00,0x80,0xc0,0x46,0x00,0x80,0x00,0x48,0x01, +0x00,0x16,0xc0,0x00,0x81,0x00,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x1a,0xc0,0x00, +0x81,0x40,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x03,0x04,0x01,0x80,0x01,0x84,0x02, +0x00,0x00,0x05,0x00,0x81,0xc1,0x20,0x00,0x80,0x00,0x48,0x01,0x00,0x1e,0xc0,0x00, +0x82,0x00,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x22,0xc0,0x00,0x82,0x40,0x46,0x00, +0x80,0x00,0x48,0x01,0x00,0x26,0xc0,0x00,0x82,0x80,0x46,0x00,0x80,0x00,0x48,0x01, +0x00,0x2a,0xc0,0x00,0x82,0xc0,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x06,0x04,0x01, +0x80,0x05,0x84,0x02,0x00,0x00,0x05,0x00,0x81,0xc1,0x20,0x00,0x80,0x00,0x48,0x01, +0x00,0x06,0x84,0x01,0x80,0x01,0x04,0x02,0x00,0x00,0x05,0x00,0x81,0xc1,0x20,0x00, +0x80,0x00,0x48,0x01,0x00,0x30,0xc0,0x00,0x83,0x80,0x46,0x00,0x80,0x00,0x48,0x01, +0x00,0x34,0xc0,0x00,0x83,0xc0,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x08,0x04,0x01, +0x80,0x05,0x04,0x02,0x00,0x00,0x05,0x00,0x81,0xc1,0x20,0x00,0x80,0x00,0x48,0x01, +0x00,0x38,0xc0,0x00,0x84,0x40,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x3c,0xc0,0x00, +0x84,0x80,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x09,0x84,0x01,0x80,0x04,0x04,0x02, +0x00,0x00,0x05,0x00,0x81,0xc1,0x20,0x00,0x80,0x00,0x48,0x01,0x00,0x40,0xc0,0x00, +0x85,0x00,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x44,0xc0,0x00,0x85,0x40,0x46,0x00, +0x80,0x00,0x48,0x01,0x00,0x0b,0x04,0x01,0x80,0x02,0x84,0x02,0x00,0x00,0x05,0x00, +0x81,0xc1,0x20,0x01,0x00,0x00,0x29,0x5e,0x8d,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x17,0x00,0x04,0x61,0x6c,0x6c,0x3f,0x00,0x04,0x61,0x6e,0x79,0x3f,0x00, +0x07,0x63,0x6f,0x6c,0x6c,0x65,0x63,0x74,0x00,0x06,0x64,0x65,0x74,0x65,0x63,0x74, +0x00,0x0f,0x65,0x61,0x63,0x68,0x5f,0x77,0x69,0x74,0x68,0x5f,0x69,0x6e,0x64,0x65, +0x78,0x00,0x07,0x65,0x6e,0x74,0x72,0x69,0x65,0x73,0x00,0x04,0x66,0x69,0x6e,0x64, +0x00,0x0c,0x61,0x6c,0x69,0x61,0x73,0x5f,0x6d,0x65,0x74,0x68,0x6f,0x64,0x00,0x08, +0x66,0x69,0x6e,0x64,0x5f,0x61,0x6c,0x6c,0x00,0x04,0x67,0x72,0x65,0x70,0x00,0x08, +0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x3f,0x00,0x06,0x69,0x6e,0x6a,0x65,0x63,0x74, +0x00,0x06,0x72,0x65,0x64,0x75,0x63,0x65,0x00,0x03,0x6d,0x61,0x70,0x00,0x03,0x6d, +0x61,0x78,0x00,0x03,0x6d,0x69,0x6e,0x00,0x07,0x6d,0x65,0x6d,0x62,0x65,0x72,0x3f, +0x00,0x09,0x70,0x61,0x72,0x74,0x69,0x74,0x69,0x6f,0x6e,0x00,0x06,0x72,0x65,0x6a, +0x65,0x63,0x74,0x00,0x06,0x73,0x65,0x6c,0x65,0x63,0x74,0x00,0x0c,0x5f,0x5f,0x73, +0x6f,0x72,0x74,0x5f,0x73,0x75,0x62,0x5f,0x5f,0x00,0x04,0x73,0x6f,0x72,0x74,0x00, +0x04,0x74,0x6f,0x5f,0x61,0xfb,0x20,0x00,0x00,0x00,0x52,0x53,0x43,0x00,0x03,0x00, +0x05,0x00,0x02,0x48,0x39,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0xa6,0x01,0x00,0x00, +0x07,0x01,0x80,0x40,0x01,0x01,0xc0,0x02,0x19,0x01,0x80,0x00,0x06,0x02,0x00,0x03, +0x40,0x01,0x80,0x00,0x21,0x00,0x40,0x01,0x97,0x01,0x80,0x00,0x06,0x02,0x00,0x05, +0x40,0x01,0x80,0x00,0x21,0x01,0x00,0x00,0x29,0xc0,0xb7,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x65,0x61,0x63,0x68,0x9d,0xa1,0x00,0x00,0x00, +0x4e,0x53,0x43,0x00,0x03,0x00,0x05,0x00,0x02,0x48,0x39,0x00,0x00,0x00,0x0b,0x02, +0x00,0x00,0x26,0x01,0x80,0x40,0x15,0x02,0x00,0x40,0x01,0x01,0x80,0x00,0xa0,0x01, +0xc0,0x01,0x19,0x01,0x80,0x00,0x05,0x00,0x40,0x01,0x97,0x01,0x80,0x00,0x08,0x01, +0x80,0x80,0x16,0x01,0x80,0x40,0x29,0x01,0x80,0x00,0x29,0xf1,0xb6,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x63,0x61,0x6c,0x6c,0x38,0x03,0x00, +0x00,0x00,0x40,0x53,0x43,0x00,0x03,0x00,0x04,0x00,0x02,0x58,0x18,0x00,0x00,0x00, +0x09,0x02,0x00,0x00,0x26,0x01,0x80,0x40,0x01,0x01,0xc0,0x01,0x19,0x01,0x80,0x00, +0x05,0x00,0x40,0x01,0x97,0x01,0x80,0x00,0x08,0x01,0x80,0x80,0x16,0x01,0x80,0x40, +0x29,0x01,0x80,0x00,0x29,0xcd,0xbc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x52,0x53,0x43,0x00,0x03,0x00,0x05,0x00,0x02,0x48, +0x39,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0xa6,0x01,0x00,0x00,0x08,0x01,0x80,0x40, +0x01,0x01,0xc0,0x02,0x19,0x01,0x80,0x00,0x06,0x02,0x00,0x03,0x40,0x01,0x80,0x00, +0x21,0x00,0x40,0x01,0x97,0x01,0x80,0x00,0x06,0x02,0x00,0x05,0x40,0x01,0x80,0x00, +0x21,0x01,0x00,0x00,0x29,0x14,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x01,0x00,0x04,0x65,0x61,0x63,0x68,0x9d,0xa1,0x00,0x00,0x00,0x4a,0x53,0x43,0x00, +0x03,0x00,0x05,0x00,0x02,0x48,0x39,0x00,0x00,0x00,0x0a,0x02,0x00,0x00,0x26,0x01, +0x80,0x40,0x15,0x02,0x00,0x40,0x01,0x01,0x80,0x00,0xa0,0x01,0xc0,0x02,0x19,0x01, +0x80,0x00,0x07,0x01,0x80,0x80,0x16,0x01,0x80,0x40,0x29,0x01,0x80,0x00,0x05,0x01, +0x80,0x00,0x29,0xca,0x99,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, +0x04,0x63,0x61,0x6c,0x6c,0x38,0x03,0x00,0x00,0x00,0x3c,0x53,0x43,0x00,0x03,0x00, +0x04,0x00,0x02,0x58,0x18,0x00,0x00,0x00,0x08,0x02,0x00,0x00,0x26,0x01,0x80,0x40, +0x01,0x01,0xc0,0x02,0x19,0x01,0x80,0x00,0x07,0x01,0x80,0x80,0x16,0x01,0x80,0x40, +0x29,0x01,0x80,0x00,0x05,0x01,0x80,0x00,0x29,0x76,0x51,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3a,0x53,0x43,0x00,0x03,0x00, +0x05,0x00,0x02,0x48,0x39,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0xa6,0x01,0x00,0xc0, +0x37,0x01,0x80,0x00,0x06,0x02,0x00,0x03,0x40,0x01,0x80,0x00,0x21,0x01,0x00,0x00, +0x29,0x96,0xb1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x65, +0x61,0x63,0x68,0x9d,0xa1,0x00,0x00,0x00,0x44,0x53,0x43,0x00,0x03,0x00,0x06,0x00, +0x02,0x78,0x5a,0x00,0x00,0x00,0x07,0x02,0x00,0x00,0x26,0x01,0x80,0x80,0x15,0x02, +0x00,0x40,0x15,0x02,0x80,0x40,0x01,0x02,0x00,0x40,0xa0,0x01,0x80,0x00,0xa0,0x01, +0x80,0x00,0x29,0x4f,0x59,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00, +0x04,0x70,0x75,0x73,0x68,0x00,0x04,0x63,0x61,0x6c,0x6c,0x73,0x49,0x00,0x00,0x00, +0x46,0x53,0x43,0x00,0x04,0x00,0x06,0x00,0x02,0xfd,0xca,0x00,0x00,0x00,0x09,0x00, +0x10,0x00,0xa6,0x00,0x40,0x00,0x97,0x00,0x40,0x00,0x97,0x00,0x80,0x00,0x05,0x01, +0x80,0x40,0x01,0x02,0x00,0x00,0x06,0x02,0x80,0x03,0x40,0x02,0x00,0x00,0x21,0x01, +0x80,0x00,0x29,0xb3,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, +0x04,0x65,0x61,0x63,0x68,0x9d,0xa1,0x00,0x00,0x00,0x46,0x53,0x43,0x00,0x03,0x00, +0x05,0x00,0x02,0x48,0x39,0x00,0x00,0x00,0x09,0x02,0x00,0x00,0x26,0x01,0x80,0x80, +0x15,0x02,0x00,0x40,0x01,0x01,0x80,0x00,0xa0,0x01,0xc0,0x01,0x99,0x00,0x80,0xc0, +0x16,0x01,0x80,0x40,0x29,0x01,0x80,0x00,0x05,0x01,0x80,0x00,0x29,0x93,0x03,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x63,0x61,0x6c,0x6c,0x38, +0x03,0x00,0x00,0x00,0x3e,0x53,0x43,0x00,0x03,0x00,0x05,0x00,0x02,0x48,0x39,0x00, +0x00,0x00,0x07,0x00,0x00,0x00,0xa6,0x01,0x3f,0xff,0x83,0x01,0x80,0x00,0x06,0x02, +0x00,0x03,0x40,0x01,0x80,0x00,0x21,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x29,0x95, +0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x65,0x61,0x63, +0x68,0x9d,0xa1,0x00,0x00,0x00,0x49,0x53,0x43,0x00,0x03,0x00,0x06,0x00,0x02,0x78, +0x5a,0x00,0x00,0x00,0x09,0x02,0x00,0x00,0x26,0x01,0x80,0x40,0x15,0x02,0x00,0x40, +0x01,0x02,0x80,0x80,0x15,0x01,0x80,0x01,0x20,0x01,0x80,0x80,0x15,0x01,0x80,0x40, +0xad,0x01,0x80,0x80,0x16,0x01,0x80,0x00,0x29,0xd2,0x3a,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x02,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x01,0x2b,0xf0,0x09, +0x00,0x00,0x00,0x3a,0x53,0x43,0x00,0x03,0x00,0x05,0x00,0x02,0x48,0x39,0x00,0x00, +0x00,0x06,0x00,0x00,0x00,0x26,0x01,0x00,0xc0,0x37,0x01,0x80,0x00,0x06,0x02,0x00, +0x03,0x40,0x01,0x80,0x00,0x21,0x01,0x00,0x00,0x29,0x04,0x78,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x65,0x61,0x63,0x68,0x9d,0xa1,0x00,0x00, +0x00,0x36,0x53,0x43,0x00,0x03,0x00,0x05,0x00,0x02,0x48,0x39,0x00,0x00,0x00,0x05, +0x02,0x00,0x00,0x26,0x01,0x80,0x80,0x15,0x02,0x00,0x40,0x01,0x01,0x80,0x00,0xa0, +0x01,0x80,0x00,0x29,0x7d,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, +0x00,0x04,0x70,0x75,0x73,0x68,0x23,0x92,0x00,0x00,0x00,0x3a,0x53,0x43,0x00,0x03, +0x00,0x05,0x00,0x02,0x48,0x39,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0xa6,0x01,0x00, +0xc0,0x37,0x01,0x80,0x00,0x06,0x02,0x00,0x03,0x40,0x01,0x80,0x00,0x21,0x01,0x00, +0x00,0x29,0x96,0xb1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04, +0x65,0x61,0x63,0x68,0x9d,0xa1,0x00,0x00,0x00,0x50,0x53,0x43,0x00,0x03,0x00,0x05, +0x00,0x02,0x48,0x39,0x00,0x00,0x00,0x0a,0x02,0x00,0x00,0x26,0x01,0x80,0x40,0x15, +0x02,0x00,0x40,0x01,0x01,0x80,0x00,0xa0,0x01,0xc0,0x02,0x19,0x01,0x80,0x80,0x15, +0x02,0x00,0x40,0x01,0x01,0x80,0x40,0xa0,0x01,0x80,0x00,0x05,0x01,0x80,0x00,0x29, +0x72,0xec,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x04,0x63,0x61, +0x6c,0x6c,0x00,0x04,0x70,0x75,0x73,0x68,0x3d,0x25,0x00,0x00,0x00,0x3a,0x53,0x43, +0x00,0x04,0x00,0x06,0x00,0x02,0xfd,0xca,0x00,0x00,0x00,0x06,0x02,0x00,0x00,0xa6, +0x01,0x81,0x00,0x37,0x02,0x00,0x00,0x06,0x02,0x80,0x03,0x40,0x02,0x00,0x00,0x21, +0x01,0x80,0x00,0x29,0xd3,0xbb,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, +0x00,0x04,0x65,0x61,0x63,0x68,0x9d,0xa1,0x00,0x00,0x00,0x6d,0x53,0x43,0x00,0x03, +0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x10,0x02,0x00,0x00,0x26,0x01,0x80, +0x40,0x15,0x02,0x00,0x40,0x01,0x01,0x80,0x00,0xa0,0x01,0xc0,0x05,0x19,0x01,0x80, +0xc0,0x15,0x02,0x00,0x80,0x15,0x02,0x40,0x02,0x19,0x02,0x00,0x80,0x15,0x02,0x80, +0x40,0x01,0x02,0x00,0x80,0xa0,0x00,0x40,0x00,0x97,0x02,0x00,0x40,0x01,0x01,0x80, +0x40,0xa0,0x01,0x80,0x00,0x05,0x01,0x80,0x00,0x29,0x07,0x19,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x3d,0x3d,0x3d,0x00,0x04,0x70,0x75,0x73, +0x68,0x00,0x04,0x63,0x61,0x6c,0x6c,0x5e,0x62,0x00,0x00,0x00,0x3a,0x53,0x43,0x00, +0x04,0x00,0x06,0x00,0x02,0xfd,0xca,0x00,0x00,0x00,0x06,0x02,0x00,0x00,0x26,0x01, +0x80,0x00,0x08,0x02,0x00,0x00,0x06,0x02,0x80,0x03,0x40,0x02,0x00,0x00,0x21,0x01, +0x80,0x00,0x29,0xdd,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, +0x04,0x65,0x61,0x63,0x68,0x9d,0xa1,0x00,0x00,0x00,0x48,0x53,0x43,0x00,0x03,0x00, +0x05,0x00,0x02,0x48,0x39,0x00,0x00,0x00,0x0a,0x02,0x00,0x00,0x26,0x01,0x80,0x40, +0x01,0x02,0x00,0x40,0x15,0x01,0x80,0x00,0xb2,0x01,0xc0,0x02,0x19,0x01,0x80,0x00, +0x07,0x01,0x80,0xc0,0x16,0x01,0x80,0x40,0x29,0x01,0x80,0x00,0x05,0x01,0x80,0x00, +0x29,0x85,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x02,0x3d, +0x3d,0x2a,0x4f,0x00,0x00,0x01,0x10,0x53,0x43,0x00,0x06,0x00,0x09,0x00,0x02,0x62, +0x45,0x00,0x00,0x00,0x27,0x00,0x08,0x00,0xa6,0x03,0x00,0x40,0x01,0x03,0x00,0x00, +0x20,0x03,0xc0,0x00,0x83,0x03,0x00,0x40,0xb5,0x03,0x40,0x02,0x19,0x03,0x00,0x00, +0x06,0x03,0x80,0x01,0x91,0x04,0x00,0x00,0x3d,0x03,0x00,0x81,0x20,0x03,0x00,0x02, +0x11,0x03,0x80,0x40,0x01,0x04,0x3f,0xff,0x03,0x03,0x81,0x80,0xa0,0x03,0x01,0x40, +0xa0,0x03,0x40,0x04,0x19,0x03,0x00,0x40,0x01,0x03,0xbf,0xff,0x03,0x03,0x01,0x80, +0xa0,0x01,0x81,0x80,0x01,0x03,0x00,0x03,0xc0,0x01,0x01,0x80,0x01,0x03,0x00,0x40, +0x01,0x03,0x01,0xc0,0x20,0x03,0x00,0x40,0x01,0x03,0x02,0x00,0x20,0x03,0x40,0x01, +0x99,0x02,0x00,0x00,0x07,0x02,0x80,0x00,0x05,0x00,0x40,0x02,0x97,0x02,0x00,0x00, +0x08,0x03,0x00,0x40,0x01,0x03,0xbf,0xff,0x83,0x03,0x01,0x80,0xa0,0x02,0x81,0x80, +0x01,0x03,0x00,0x00,0x06,0x03,0x80,0x05,0x40,0x03,0x02,0x40,0x21,0x02,0x80,0x00, +0x29,0xa0,0x27,0x00,0x00,0x00,0x01,0x11,0x00,0x12,0x74,0x6f,0x6f,0x20,0x6d,0x61, +0x6e,0x79,0x20,0x61,0x72,0x67,0x75,0x6d,0x65,0x6e,0x74,0x73,0x04,0x88,0x00,0x00, +0x00,0x0a,0x00,0x04,0x73,0x69,0x7a,0x65,0x00,0x01,0x3e,0x00,0x05,0x72,0x61,0x69, +0x73,0x65,0x00,0x0d,0x41,0x72,0x67,0x75,0x6d,0x65,0x6e,0x74,0x45,0x72,0x72,0x6f, +0x72,0x00,0x06,0x53,0x79,0x6d,0x62,0x6f,0x6c,0x00,0x03,0x3d,0x3d,0x3d,0x00,0x02, +0x5b,0x5d,0x00,0x03,0x70,0x6f,0x70,0x00,0x06,0x65,0x6d,0x70,0x74,0x79,0x3f,0x00, +0x04,0x65,0x61,0x63,0x68,0x6c,0x50,0x00,0x00,0x00,0x3a,0x53,0x43,0x00,0x04,0x00, +0x07,0x00,0x02,0xed,0xeb,0x00,0x00,0x00,0x06,0x04,0x00,0x00,0x26,0x02,0x00,0x40, +0x01,0x02,0x80,0xc0,0x15,0x03,0x00,0x80,0x01,0x02,0x00,0x01,0x20,0x02,0x00,0x00, +0x29,0xbe,0x91,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x73, +0x65,0x6e,0x64,0x79,0xfc,0x00,0x00,0x00,0x5a,0x53,0x43,0x00,0x03,0x00,0x06,0x00, +0x02,0x78,0x5a,0x00,0x00,0x00,0x0e,0x02,0x00,0x00,0x26,0x01,0x81,0x00,0x15,0x01, +0xc0,0x02,0x99,0x01,0x80,0x00,0x08,0x01,0x81,0x00,0x16,0x01,0x80,0x40,0x01,0x01, +0x81,0x40,0x16,0x00,0x40,0x02,0x97,0x01,0x80,0x80,0x15,0x02,0x01,0x40,0x15,0x02, +0x80,0x40,0x01,0x01,0x80,0x01,0x20,0x01,0x81,0x40,0x16,0x01,0x80,0x00,0x29,0xb0, +0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x63,0x61,0x6c, +0x6c,0x38,0x03,0x00,0x00,0x00,0x3e,0x53,0x43,0x00,0x04,0x00,0x06,0x00,0x02,0xfd, +0xca,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0xa6,0x01,0x00,0x00,0x07,0x01,0x80,0x00, +0x05,0x02,0x00,0x00,0x06,0x02,0x80,0x03,0x40,0x02,0x00,0x00,0x21,0x01,0x80,0x00, +0x29,0x5e,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x65, +0x61,0x63,0x68,0x9d,0xa1,0x00,0x00,0x00,0xa2,0x53,0x43,0x00,0x03,0x00,0x06,0x00, +0x02,0x78,0x5a,0x00,0x00,0x00,0x1e,0x02,0x00,0x00,0x26,0x01,0x80,0x80,0x15,0x01, +0xc0,0x02,0x19,0x00,0x80,0xc0,0x16,0x01,0x80,0x00,0x08,0x01,0x80,0x80,0x16,0x00, +0x40,0x0b,0x17,0x01,0x80,0x40,0x15,0x01,0xc0,0x05,0x99,0x01,0x80,0x40,0x15,0x02, +0x00,0x40,0x01,0x02,0x80,0xc0,0x15,0x01,0x80,0x01,0x20,0x02,0x3f,0xff,0x83,0x01, +0x80,0x40,0xb5,0x01,0xc0,0x01,0x99,0x01,0x80,0x40,0x01,0x01,0x80,0xc0,0x16,0x01, +0x80,0x00,0x05,0x00,0x40,0x04,0x97,0x01,0x80,0x40,0x01,0x02,0x00,0xc0,0x15,0x01, +0x80,0x80,0xa0,0x02,0x3f,0xff,0x83,0x01,0x80,0x40,0xb5,0x01,0xc0,0x01,0x99,0x01, +0x80,0x40,0x01,0x01,0x80,0xc0,0x16,0x01,0x80,0x00,0x05,0x01,0x80,0x00,0x29,0x8c, +0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x04,0x63,0x61,0x6c, +0x6c,0x00,0x01,0x3e,0x00,0x03,0x3c,0x3d,0x3e,0xb1,0x12,0x00,0x00,0x00,0x3e,0x53, +0x43,0x00,0x04,0x00,0x06,0x00,0x02,0xfd,0xca,0x00,0x00,0x00,0x07,0x00,0x00,0x00, +0xa6,0x01,0x00,0x00,0x07,0x01,0x80,0x00,0x05,0x02,0x00,0x00,0x06,0x02,0x80,0x03, +0x40,0x02,0x00,0x00,0x21,0x01,0x80,0x00,0x29,0x5e,0x55,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x65,0x61,0x63,0x68,0x9d,0xa1,0x00,0x00,0x00, +0xa2,0x53,0x43,0x00,0x03,0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x1e,0x02, +0x00,0x00,0x26,0x01,0x80,0x80,0x15,0x01,0xc0,0x02,0x19,0x00,0x80,0xc0,0x16,0x01, +0x80,0x00,0x08,0x01,0x80,0x80,0x16,0x00,0x40,0x0b,0x17,0x01,0x80,0x40,0x15,0x01, +0xc0,0x05,0x99,0x01,0x80,0x40,0x15,0x02,0x00,0x40,0x01,0x02,0x80,0xc0,0x15,0x01, +0x80,0x01,0x20,0x02,0x3f,0xff,0x83,0x01,0x80,0x40,0xb3,0x01,0xc0,0x01,0x99,0x01, +0x80,0x40,0x01,0x01,0x80,0xc0,0x16,0x01,0x80,0x00,0x05,0x00,0x40,0x04,0x97,0x01, +0x80,0x40,0x01,0x02,0x00,0xc0,0x15,0x01,0x80,0x80,0xa0,0x02,0x3f,0xff,0x83,0x01, +0x80,0x40,0xb3,0x01,0xc0,0x01,0x99,0x01,0x80,0x40,0x01,0x01,0x80,0xc0,0x16,0x01, +0x80,0x00,0x05,0x01,0x80,0x00,0x29,0x87,0x69,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x03,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x01,0x3c,0x00,0x03,0x3c,0x3d, +0x3e,0x5c,0x7a,0x00,0x00,0x00,0x4a,0x53,0x43,0x00,0x04,0x00,0x06,0x00,0x02,0xfd, +0xca,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xa6,0x01,0x01,0x00,0x37,0x01,0x81,0x00, +0x37,0x02,0x00,0x00,0x06,0x02,0x80,0x03,0x40,0x02,0x00,0x00,0x21,0x02,0x00,0x80, +0x01,0x02,0x80,0xc0,0x01,0x00,0x01,0x01,0x37,0x00,0x00,0x00,0x29,0x16,0x29,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x65,0x61,0x63,0x68,0x9d, +0xa1,0x00,0x00,0x00,0x5c,0x53,0x43,0x00,0x03,0x00,0x05,0x00,0x02,0x48,0x39,0x00, +0x00,0x00,0x0d,0x02,0x00,0x00,0x26,0x01,0x80,0x40,0x15,0x02,0x00,0x40,0x01,0x01, +0x80,0x00,0xa0,0x01,0xc0,0x02,0x19,0x01,0x80,0x80,0x15,0x02,0x00,0x40,0x01,0x01, +0x80,0x40,0xa0,0x00,0x40,0x01,0x97,0x01,0x80,0xc0,0x15,0x02,0x00,0x40,0x01,0x01, +0x80,0x40,0xa0,0x01,0x80,0x00,0x29,0xa1,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x02,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x04,0x70,0x75,0x73,0x68,0x3d, +0x25,0x00,0x00,0x00,0x3a,0x53,0x43,0x00,0x03,0x00,0x05,0x00,0x02,0x48,0x39,0x00, +0x00,0x00,0x06,0x00,0x00,0x00,0xa6,0x01,0x00,0xc0,0x37,0x01,0x80,0x00,0x06,0x02, +0x00,0x03,0x40,0x01,0x80,0x00,0x21,0x01,0x00,0x00,0x29,0x96,0xb1,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x65,0x61,0x63,0x68,0x9d,0xa1,0x00, +0x00,0x00,0x54,0x53,0x43,0x00,0x03,0x00,0x05,0x00,0x02,0x48,0x39,0x00,0x00,0x00, +0x0b,0x02,0x00,0x00,0x26,0x01,0x80,0x40,0x15,0x02,0x00,0x40,0x01,0x01,0x80,0x00, +0xa0,0x01,0xc0,0x01,0x19,0x01,0x80,0x00,0x05,0x00,0x40,0x01,0x97,0x01,0x80,0x80, +0x15,0x02,0x00,0x40,0x01,0x01,0x80,0x40,0xa0,0x01,0x80,0x00,0x29,0xab,0x72,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00, +0x04,0x70,0x75,0x73,0x68,0x3d,0x25,0x00,0x00,0x01,0x90,0x53,0x43,0x00,0x0c,0x00, +0x13,0x00,0x02,0x16,0xff,0x00,0x00,0x00,0x51,0x0a,0x00,0x00,0xa6,0x06,0x01,0x00, +0x01,0x06,0x81,0x40,0x01,0x06,0x00,0x00,0xb2,0x06,0x40,0x06,0x19,0x06,0x00,0xc0, +0x01,0x06,0xc0,0x00,0x03,0x06,0x00,0x00,0xb2,0x06,0x40,0x03,0x99,0x06,0x00,0x80, +0x01,0x06,0x81,0x00,0x01,0x06,0x00,0x40,0xa0,0x06,0x80,0x40,0x01,0x07,0x01,0x00, +0x01,0x07,0x83,0x00,0x01,0x06,0x80,0x81,0x20,0x05,0x80,0x00,0x29,0x06,0x00,0xc0, +0x01,0x06,0xbf,0xff,0x83,0x06,0x00,0x00,0xb2,0x06,0x40,0x02,0x99,0x06,0x00,0x40, +0x01,0x06,0x80,0x80,0x01,0x03,0x83,0x00,0x01,0x04,0x03,0x40,0x01,0x00,0x40,0x02, +0x17,0x06,0x00,0x80,0x01,0x06,0x80,0x40,0x01,0x03,0x83,0x00,0x01,0x04,0x03,0x40, +0x01,0x06,0x01,0xc0,0x01,0x06,0x81,0x00,0x01,0x06,0x00,0x40,0xa0,0x04,0x83,0x00, +0x01,0x06,0x01,0x00,0x01,0x06,0x81,0x40,0x01,0x05,0x03,0x00,0x01,0x05,0x83,0x40, +0x01,0x06,0x01,0x00,0x01,0x06,0x00,0xc0,0xad,0x06,0x81,0x40,0x01,0x07,0x00,0x03, +0x40,0x06,0x01,0x00,0xa1,0x06,0x02,0x40,0x01,0x06,0x80,0x40,0x01,0x07,0x02,0x80, +0x01,0x07,0x83,0x00,0x01,0x06,0x80,0x81,0x20,0x06,0x00,0xc0,0x01,0x06,0x00,0xc0, +0xad,0x06,0xc0,0x00,0x83,0x06,0x01,0x40,0xa0,0x01,0x83,0x00,0x01,0x06,0x02,0x80, +0x01,0x06,0x81,0x00,0x01,0x06,0x01,0x80,0xb5,0x06,0x40,0x04,0x99,0x06,0x00,0x00, +0x06,0x06,0x80,0x40,0x01,0x07,0x00,0x80,0x01,0x07,0x80,0xc0,0x01,0x08,0x01,0x00, +0x01,0x08,0x82,0x80,0x01,0x08,0x82,0x00,0xaf,0x09,0x01,0x80,0x01,0x06,0x01,0xc2, +0xa1,0x06,0x02,0x80,0x01,0x06,0x81,0x40,0x01,0x06,0x02,0x40,0xb3,0x06,0x40,0x05, +0x19,0x06,0x00,0x00,0x06,0x06,0x80,0x40,0x01,0x07,0x00,0x80,0x01,0x07,0x80,0xc0, +0x01,0x08,0x02,0x80,0x01,0x08,0x00,0xc0,0xad,0x08,0x81,0x40,0x01,0x09,0x01,0x80, +0x01,0x06,0x01,0xc2,0xa1,0x06,0x00,0x00,0x05,0x06,0x00,0x00,0x29,0x55,0x5a,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x02,0x3d,0x3d,0x00,0x02,0x5b, +0x5d,0x00,0x03,0x5b,0x5d,0x3d,0x00,0x01,0x2b,0x00,0x04,0x75,0x70,0x74,0x6f,0x00, +0x01,0x25,0x00,0x01,0x3e,0x00,0x0c,0x5f,0x5f,0x73,0x6f,0x72,0x74,0x5f,0x73,0x75, +0x62,0x5f,0x5f,0x00,0x01,0x2d,0x00,0x01,0x3c,0xdc,0x00,0x00,0x00,0x00,0xd9,0x53, +0x43,0x00,0x03,0x00,0x07,0x00,0x02,0x68,0x7b,0x00,0x00,0x00,0x28,0x02,0x00,0x00, +0x26,0x01,0x81,0x80,0x15,0x01,0xc0,0x03,0x99,0x01,0x81,0x80,0x15,0x02,0x01,0xc0, +0x15,0x02,0x80,0x40,0x01,0x02,0x00,0x40,0xa0,0x02,0x82,0x40,0x15,0x01,0x80,0x01, +0x20,0x00,0x40,0x02,0x97,0x01,0x81,0xc0,0x15,0x02,0x00,0x40,0x01,0x01,0x80,0x40, +0xa0,0x02,0x02,0x40,0x15,0x01,0x80,0x80,0xa0,0x02,0x3f,0xff,0x83,0x01,0x80,0xc0, +0xb5,0x01,0xc0,0x05,0x99,0x01,0x81,0xc0,0x15,0x02,0x00,0x40,0x01,0x01,0x80,0x40, +0xa0,0x02,0x02,0x00,0x15,0x02,0x82,0xc0,0x15,0x03,0x00,0xc0,0x01,0x02,0x01,0x01, +0x20,0x01,0x82,0xc0,0x15,0x01,0x81,0x40,0xaf,0x01,0x82,0xc0,0x16,0x00,0x40,0x05, +0x17,0x01,0x81,0xc0,0x15,0x02,0x00,0x40,0x01,0x01,0x80,0x40,0xa0,0x02,0x02,0x00, +0x15,0x02,0x82,0x80,0x15,0x03,0x00,0xc0,0x01,0x02,0x01,0x01,0x20,0x01,0x82,0x80, +0x15,0x01,0x81,0x80,0xad,0x01,0x82,0x80,0x16,0x01,0x80,0x00,0x29,0x42,0xcd,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00, +0x02,0x5b,0x5d,0x00,0x03,0x3c,0x3d,0x3e,0x00,0x01,0x3e,0x00,0x03,0x5b,0x5d,0x3d, +0x00,0x01,0x2d,0x00,0x01,0x2b,0xdb,0x0e,0x00,0x00,0x00,0xad,0x53,0x43,0x00,0x03, +0x00,0x0a,0x00,0x02,0xb9,0xd6,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0xa6,0x01,0x00, +0xc0,0x37,0x01,0x80,0x00,0x06,0x02,0x00,0x03,0x40,0x01,0x80,0x00,0x21,0x01,0x80, +0x80,0x01,0x01,0x80,0x40,0x20,0x01,0xc0,0x00,0x99,0x00,0x40,0x07,0x17,0x01,0x80, +0x00,0x06,0x02,0x00,0x80,0x01,0x02,0x80,0x00,0x42,0x02,0x80,0x01,0x93,0x03,0x00, +0x80,0x01,0x03,0x01,0x40,0x20,0x02,0x81,0x00,0xa0,0x03,0x3f,0xff,0x83,0x03,0xbf, +0xff,0x83,0x04,0x00,0x80,0x01,0x04,0x01,0x40,0x20,0x04,0x01,0x80,0xaf,0x04,0x80, +0x40,0x01,0x01,0x80,0x82,0xa1,0x01,0x00,0x00,0x29,0xe7,0x8c,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x04,0x65,0x61,0x63,0x68,0x00,0x06,0x65,0x6d, +0x70,0x74,0x79,0x3f,0x00,0x0c,0x5f,0x5f,0x73,0x6f,0x72,0x74,0x5f,0x73,0x75,0x62, +0x5f,0x5f,0x00,0x05,0x41,0x72,0x72,0x61,0x79,0x00,0x03,0x6e,0x65,0x77,0x00,0x04, +0x73,0x69,0x7a,0x65,0x00,0x01,0x2d,0x10,0x10,0x00,0x00,0x00,0x36,0x53,0x43,0x00, +0x03,0x00,0x05,0x00,0x02,0x48,0x39,0x00,0x00,0x00,0x05,0x02,0x00,0x00,0x26,0x01, +0x80,0x80,0x15,0x02,0x00,0x40,0x01,0x01,0x80,0x00,0xa0,0x01,0x80,0x00,0x29,0x7d, +0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x70,0x75,0x73, +0x68,0x23,0x92,0x00,0x00,0x01,0x0c,0x53,0x43,0x00,0x01,0x00,0x03,0x00,0x02,0x46, +0x9f,0x00,0x00,0x00,0x2b,0x00,0x80,0x00,0x11,0x01,0x00,0x01,0x04,0x00,0x80,0x40, +0xa0,0x00,0xc0,0x0c,0x99,0x00,0x80,0x00,0x11,0x01,0x00,0x01,0x84,0x00,0x80,0x40, +0xa0,0x00,0xc0,0x00,0x99,0x00,0x40,0x03,0x17,0x00,0x80,0x00,0x48,0x01,0x00,0x02, +0xc0,0x00,0x81,0x00,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x04,0xc0,0x00,0x80,0xc0, +0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x06,0xc0,0x00,0x81,0x40,0x46,0x00,0x80,0x00, +0x48,0x01,0x00,0x08,0xc0,0x00,0x81,0x80,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x0a, +0xc0,0x00,0x81,0xc0,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x0c,0xc0,0x00,0x81,0x00, +0x46,0x00,0x80,0x00,0x05,0x00,0x40,0x06,0x97,0x00,0x00,0x00,0x48,0x00,0x80,0x0e, +0xc0,0x00,0x01,0x40,0x46,0x00,0x00,0x00,0x48,0x00,0x80,0x10,0xc0,0x00,0x01,0x80, +0x46,0x00,0x00,0x00,0x48,0x00,0x80,0x12,0xc0,0x00,0x01,0xc0,0x46,0x00,0x00,0x00, +0x48,0x00,0x80,0x14,0xc0,0x00,0x01,0x00,0x46,0x00,0x00,0x00,0x05,0x00,0x00,0x00, +0x29,0x26,0xf2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x06,0x4b, +0x65,0x72,0x6e,0x65,0x6c,0x00,0x0b,0x72,0x65,0x73,0x70,0x6f,0x6e,0x64,0x5f,0x74, +0x6f,0x3f,0x00,0x0c,0x5f,0x5f,0x70,0x72,0x69,0x6e,0x74,0x73,0x74,0x72,0x5f,0x5f, +0x00,0x07,0x73,0x70,0x72,0x69,0x6e,0x74,0x66,0x00,0x06,0x70,0x72,0x69,0x6e,0x74, +0x66,0x00,0x05,0x70,0x72,0x69,0x6e,0x74,0x00,0x04,0x70,0x75,0x74,0x73,0x00,0x01, +0x70,0xcd,0x54,0x00,0x00,0x00,0x70,0x53,0x43,0x00,0x03,0x00,0x06,0x00,0x02,0x78, +0x5a,0x00,0x00,0x00,0x07,0x00,0x08,0x00,0x26,0x01,0x80,0x00,0x06,0x02,0x00,0x00, +0x91,0x02,0x80,0x00,0x3d,0x02,0x00,0x80,0xa0,0x01,0x80,0x00,0xa0,0x01,0x80,0x00, +0x29,0xbb,0xe9,0x00,0x00,0x00,0x01,0x11,0x00,0x14,0x70,0x72,0x69,0x6e,0x74,0x66, +0x20,0x6e,0x6f,0x74,0x20,0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65,0x27,0xb3, +0x00,0x00,0x00,0x03,0x00,0x05,0x72,0x61,0x69,0x73,0x65,0x00,0x13,0x4e,0x6f,0x74, +0x49,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x65,0x64,0x45,0x72,0x72,0x6f,0x72, +0x00,0x03,0x6e,0x65,0x77,0x64,0x27,0x00,0x00,0x00,0x71,0x53,0x43,0x00,0x03,0x00, +0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x07,0x00,0x08,0x00,0x26,0x01,0x80,0x00, +0x06,0x02,0x00,0x00,0x91,0x02,0x80,0x00,0x3d,0x02,0x00,0x80,0xa0,0x01,0x80,0x00, +0xa0,0x01,0x80,0x00,0x29,0xbb,0xe9,0x00,0x00,0x00,0x01,0x11,0x00,0x15,0x73,0x70, +0x72,0x69,0x6e,0x74,0x66,0x20,0x6e,0x6f,0x74,0x20,0x61,0x76,0x61,0x69,0x6c,0x61, +0x62,0x6c,0x65,0xb7,0x38,0x00,0x00,0x00,0x03,0x00,0x05,0x72,0x61,0x69,0x73,0x65, +0x00,0x13,0x4e,0x6f,0x74,0x49,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x65,0x64, +0x45,0x72,0x72,0x6f,0x72,0x00,0x03,0x6e,0x65,0x77,0x64,0x27,0x00,0x00,0x00,0x94, +0x53,0x43,0x00,0x05,0x00,0x08,0x00,0x02,0x2b,0x34,0x00,0x00,0x00,0x15,0x00,0x08, +0x00,0x26,0x01,0xbf,0xff,0x83,0x02,0x80,0x40,0x01,0x02,0x80,0x00,0x20,0x02,0x01, +0x40,0x01,0x00,0x40,0x04,0x97,0x02,0x80,0x00,0x06,0x03,0x00,0x40,0x01,0x03,0x80, +0xc0,0x01,0x03,0x00,0x80,0xa0,0x03,0x00,0xc0,0x20,0x02,0x80,0x40,0xa0,0x02,0x80, +0xc0,0x01,0x02,0x81,0x00,0xad,0x01,0x81,0x40,0x01,0x02,0x80,0xc0,0x01,0x03,0x01, +0x00,0x01,0x02,0x81,0x40,0xb3,0x02,0xbf,0xf9,0x98,0x00,0x00,0x00,0x05,0x00,0x00, +0x00,0x29,0x1d,0x91,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x04, +0x73,0x69,0x7a,0x65,0x00,0x0c,0x5f,0x5f,0x70,0x72,0x69,0x6e,0x74,0x73,0x74,0x72, +0x5f,0x5f,0x00,0x02,0x5b,0x5d,0x00,0x04,0x74,0x6f,0x5f,0x73,0x00,0x01,0x2b,0x00, +0x01,0x3c,0x20,0x74,0x00,0x00,0x00,0xf0,0x53,0x43,0x00,0x06,0x00,0x08,0x00,0x02, +0x72,0x64,0x00,0x00,0x00,0x27,0x00,0x08,0x00,0x26,0x01,0xbf,0xff,0x83,0x03,0x00, +0x40,0x01,0x03,0x00,0x00,0x20,0x02,0x01,0x80,0x01,0x00,0x40,0x0a,0x17,0x03,0x00, +0x40,0x01,0x03,0x80,0xc0,0x01,0x03,0x00,0x40,0xa0,0x03,0x00,0x80,0x20,0x02,0x81, +0x80,0x01,0x03,0x00,0x00,0x06,0x03,0x81,0x40,0x01,0x03,0x00,0xc0,0xa0,0x03,0x01, +0x40,0x01,0x03,0xbf,0xff,0x03,0x03,0x00,0x40,0xa0,0x03,0x80,0x00,0x3d,0x03,0x01, +0x00,0xa0,0x03,0x40,0x01,0x99,0x03,0x00,0x00,0x06,0x03,0x80,0x00,0xbd,0x03,0x00, +0xc0,0xa0,0x03,0x00,0xc0,0x01,0x03,0x01,0x40,0xad,0x01,0x81,0x80,0x01,0x03,0x00, +0xc0,0x01,0x03,0x81,0x00,0x01,0x03,0x01,0x80,0xb3,0x03,0x3f,0xf4,0x18,0x03,0x01, +0x00,0x01,0x03,0xbf,0xff,0x83,0x03,0x01,0xc0,0xb2,0x03,0x40,0x01,0x99,0x03,0x00, +0x00,0x06,0x03,0x80,0x01,0x3d,0x03,0x00,0xc0,0xa0,0x00,0x00,0x00,0x05,0x00,0x00, +0x00,0x29,0x5c,0x1b,0x00,0x00,0x00,0x03,0x11,0x00,0x01,0x0a,0x11,0x00,0x01,0x0a, +0x11,0x00,0x01,0x0a,0xe8,0xad,0x00,0x00,0x00,0x08,0x00,0x04,0x73,0x69,0x7a,0x65, +0x00,0x02,0x5b,0x5d,0x00,0x04,0x74,0x6f,0x5f,0x73,0x00,0x0c,0x5f,0x5f,0x70,0x72, +0x69,0x6e,0x74,0x73,0x74,0x72,0x5f,0x5f,0x00,0x02,0x21,0x3d,0x00,0x01,0x2b,0x00, +0x01,0x3c,0x00,0x02,0x3d,0x3d,0x26,0xfc,0x00,0x00,0x00,0xaf,0x53,0x43,0x00,0x05, +0x00,0x08,0x00,0x02,0x2b,0x34,0x00,0x00,0x00,0x1a,0x00,0x08,0x00,0x26,0x01,0xbf, +0xff,0x83,0x02,0x80,0x40,0x01,0x02,0x80,0x00,0x20,0x02,0x01,0x40,0x01,0x00,0x40, +0x06,0x17,0x02,0x80,0x00,0x06,0x03,0x00,0x40,0x01,0x03,0x80,0xc0,0x01,0x03,0x00, +0x80,0xa0,0x03,0x00,0xc0,0x20,0x02,0x80,0x40,0xa0,0x02,0x80,0x00,0x06,0x03,0x00, +0x00,0x3d,0x02,0x80,0x40,0xa0,0x02,0x80,0xc0,0x01,0x02,0x81,0x00,0xad,0x01,0x81, +0x40,0x01,0x02,0x80,0xc0,0x01,0x03,0x01,0x00,0x01,0x02,0x81,0x40,0xb3,0x02,0xbf, +0xf8,0x18,0x02,0x80,0x40,0x01,0x03,0x3f,0xff,0x83,0x02,0x80,0x80,0xa0,0x02,0x80, +0x00,0x29,0x00,0x1a,0x00,0x00,0x00,0x01,0x11,0x00,0x01,0x0a,0x06,0x78,0x00,0x00, +0x00,0x06,0x00,0x04,0x73,0x69,0x7a,0x65,0x00,0x0c,0x5f,0x5f,0x70,0x72,0x69,0x6e, +0x74,0x73,0x74,0x72,0x5f,0x5f,0x00,0x02,0x5b,0x5d,0x00,0x07,0x69,0x6e,0x73,0x70, +0x65,0x63,0x74,0x00,0x01,0x2b,0x00,0x01,0x3c,0x79,0x53,0x00,0x00,0x00,0x5b,0x53, +0x43,0x00,0x03,0x00,0x07,0x00,0x02,0x68,0x7b,0x00,0x00,0x00,0x0a,0x00,0x08,0x00, +0x26,0x01,0x80,0x00,0x06,0x02,0x00,0x00,0x06,0x02,0x81,0x40,0x37,0x03,0x00,0x40, +0x01,0x02,0x81,0x80,0x38,0x02,0x00,0x7f,0xa0,0x01,0x80,0x00,0xa0,0x00,0x00,0x00, +0x05,0x00,0x00,0x00,0x29,0xc0,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x02,0x00,0x0c,0x5f,0x5f,0x70,0x72,0x69,0x6e,0x74,0x73,0x74,0x72,0x5f,0x5f,0x00, +0x07,0x73,0x70,0x72,0x69,0x6e,0x74,0x66,0x77,0xa6,0x00,0x00,0x00,0x6f,0x53,0x43, +0x00,0x03,0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x07,0x00,0x08,0x00,0x26, +0x01,0x80,0x00,0x06,0x02,0x00,0x00,0x91,0x02,0x80,0x00,0x3d,0x02,0x00,0x80,0xa0, +0x01,0x80,0x00,0xa0,0x01,0x80,0x00,0x29,0xbb,0xe9,0x00,0x00,0x00,0x01,0x11,0x00, +0x13,0x70,0x72,0x69,0x6e,0x74,0x20,0x6e,0x6f,0x74,0x20,0x61,0x76,0x61,0x69,0x6c, +0x61,0x62,0x6c,0x65,0x28,0x8b,0x00,0x00,0x00,0x03,0x00,0x05,0x72,0x61,0x69,0x73, +0x65,0x00,0x13,0x4e,0x6f,0x74,0x49,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x65, +0x64,0x45,0x72,0x72,0x6f,0x72,0x00,0x03,0x6e,0x65,0x77,0x64,0x27,0x00,0x00,0x00, +0x6e,0x53,0x43,0x00,0x03,0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x07,0x00, +0x08,0x00,0x26,0x01,0x80,0x00,0x06,0x02,0x00,0x00,0x91,0x02,0x80,0x00,0x3d,0x02, +0x00,0x80,0xa0,0x01,0x80,0x00,0xa0,0x01,0x80,0x00,0x29,0xbb,0xe9,0x00,0x00,0x00, +0x01,0x11,0x00,0x12,0x70,0x75,0x74,0x73,0x20,0x6e,0x6f,0x74,0x20,0x61,0x76,0x61, +0x69,0x6c,0x61,0x62,0x6c,0x65,0x4c,0x61,0x00,0x00,0x00,0x03,0x00,0x05,0x72,0x61, +0x69,0x73,0x65,0x00,0x13,0x4e,0x6f,0x74,0x49,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e, +0x74,0x65,0x64,0x45,0x72,0x72,0x6f,0x72,0x00,0x03,0x6e,0x65,0x77,0x64,0x27,0x00, +0x00,0x00,0x6b,0x53,0x43,0x00,0x03,0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00, +0x07,0x00,0x08,0x00,0x26,0x01,0x80,0x00,0x06,0x02,0x00,0x00,0x91,0x02,0x80,0x00, +0x3d,0x02,0x00,0x80,0xa0,0x01,0x80,0x00,0xa0,0x01,0x80,0x00,0x29,0xbb,0xe9,0x00, +0x00,0x00,0x01,0x11,0x00,0x0f,0x70,0x20,0x6e,0x6f,0x74,0x20,0x61,0x76,0x61,0x69, +0x6c,0x61,0x62,0x6c,0x65,0xcf,0x9c,0x00,0x00,0x00,0x03,0x00,0x05,0x72,0x61,0x69, +0x73,0x65,0x00,0x13,0x4e,0x6f,0x74,0x49,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74, +0x65,0x64,0x45,0x72,0x72,0x6f,0x72,0x00,0x03,0x6e,0x65,0x77,0x64,0x27,0x00,0x00, +0x00,0x70,0x53,0x43,0x00,0x03,0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x07, +0x00,0x08,0x00,0x26,0x01,0x80,0x00,0x06,0x02,0x00,0x00,0x91,0x02,0x80,0x00,0x3d, +0x02,0x00,0x80,0xa0,0x01,0x80,0x00,0xa0,0x01,0x80,0x00,0x29,0xbb,0xe9,0x00,0x00, +0x00,0x01,0x11,0x00,0x14,0x70,0x72,0x69,0x6e,0x74,0x66,0x20,0x6e,0x6f,0x74,0x20, +0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65,0x27,0xb3,0x00,0x00,0x00,0x03,0x00, +0x05,0x72,0x61,0x69,0x73,0x65,0x00,0x13,0x4e,0x6f,0x74,0x49,0x6d,0x70,0x6c,0x65, +0x6d,0x65,0x6e,0x74,0x65,0x64,0x45,0x72,0x72,0x6f,0x72,0x00,0x03,0x6e,0x65,0x77, +0x64,0x27,0x00,0x00,0x00,0x61,0x53,0x43,0x00,0x01,0x00,0x02,0x00,0x02,0x56,0xbe, +0x00,0x00,0x00,0x0b,0x00,0x80,0x00,0x48,0x01,0x00,0x02,0xc0,0x00,0x80,0x00,0x46, +0x00,0x80,0x00,0x48,0x01,0x00,0x06,0xc0,0x00,0x80,0x40,0x46,0x00,0x80,0x00,0x48, +0x01,0x00,0x0a,0xc0,0x00,0x80,0x80,0x46,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x29, +0x49,0x4d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x04,0x65,0x61, +0x63,0x68,0x00,0x09,0x65,0x61,0x63,0x68,0x5f,0x70,0x61,0x69,0x72,0x00,0x06,0x73, +0x65,0x6c,0x65,0x63,0x74,0xdd,0x03,0x00,0x00,0x00,0x52,0x53,0x43,0x00,0x02,0x00, +0x04,0x00,0x02,0x6f,0x28,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0xa6,0x01,0x00,0x00, +0x06,0x01,0x00,0x00,0x20,0x01,0x00,0x40,0x20,0x01,0x80,0x03,0x40,0x01,0x00,0x80, +0x21,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x29,0xa7,0x14,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x03,0x00,0x05,0x63,0x6c,0x61,0x73,0x73,0x00,0x07,0x6d,0x65, +0x6d,0x62,0x65,0x72,0x73,0x00,0x04,0x65,0x61,0x63,0x68,0xd3,0xd7,0x00,0x00,0x00, +0x42,0x53,0x43,0x00,0x03,0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x07,0x02, +0x00,0x00,0x26,0x01,0x80,0x40,0x15,0x02,0x00,0x00,0x06,0x02,0x80,0x40,0x01,0x02, +0x00,0x40,0xa0,0x01,0x80,0x00,0xa0,0x01,0x80,0x00,0x29,0xb9,0x48,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x02,0x5b, +0x5d,0xa6,0x21,0x00,0x00,0x00,0x52,0x53,0x43,0x00,0x02,0x00,0x04,0x00,0x02,0x6f, +0x28,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0xa6,0x01,0x00,0x00,0x06,0x01,0x00,0x00, +0x20,0x01,0x00,0x40,0x20,0x01,0x80,0x03,0x40,0x01,0x00,0x80,0x21,0x00,0x00,0x00, +0x06,0x00,0x00,0x00,0x29,0xa7,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x03,0x00,0x05,0x63,0x6c,0x61,0x73,0x73,0x00,0x07,0x6d,0x65,0x6d,0x62,0x65,0x72, +0x73,0x00,0x04,0x65,0x61,0x63,0x68,0xd3,0xd7,0x00,0x00,0x00,0x52,0x53,0x43,0x00, +0x03,0x00,0x07,0x00,0x02,0x68,0x7b,0x00,0x00,0x00,0x09,0x02,0x00,0x00,0x26,0x01, +0x80,0x40,0x15,0x02,0x00,0x40,0x01,0x02,0x00,0x40,0x20,0x02,0x80,0x00,0x06,0x03, +0x00,0x40,0x01,0x02,0x80,0x80,0xa0,0x01,0x80,0x01,0x20,0x01,0x80,0x00,0x29,0xaa, +0x6a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x04,0x63,0x61,0x6c, +0x6c,0x00,0x06,0x74,0x6f,0x5f,0x73,0x79,0x6d,0x00,0x02,0x5b,0x5d,0x92,0x98,0x00, +0x00,0x00,0x52,0x53,0x43,0x00,0x03,0x00,0x05,0x00,0x02,0x48,0x39,0x00,0x00,0x00, +0x08,0x00,0x00,0x00,0xa6,0x01,0x00,0xc0,0x37,0x01,0x80,0x00,0x06,0x01,0x80,0x00, +0x20,0x01,0x80,0x40,0x20,0x02,0x00,0x03,0x40,0x01,0x80,0x80,0x21,0x01,0x00,0x00, +0x29,0x5c,0x5b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x05,0x63, +0x6c,0x61,0x73,0x73,0x00,0x07,0x6d,0x65,0x6d,0x62,0x65,0x72,0x73,0x00,0x04,0x65, +0x61,0x63,0x68,0xd3,0xd7,0x00,0x00,0x00,0x64,0x53,0x43,0x00,0x04,0x00,0x06,0x00, +0x02,0xfd,0xca,0x00,0x00,0x00,0x0e,0x02,0x00,0x00,0x26,0x02,0x00,0x00,0x06,0x02, +0x80,0x40,0x01,0x02,0x00,0x00,0xa0,0x01,0x81,0x00,0x01,0x02,0x00,0x40,0x15,0x02, +0x80,0xc0,0x01,0x02,0x00,0x40,0xa0,0x02,0x40,0x02,0x19,0x02,0x00,0x80,0x15,0x02, +0x80,0xc0,0x01,0x02,0x00,0x80,0xa0,0x02,0x00,0x00,0x05,0x02,0x00,0x00,0x29,0x54, +0xef,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x02,0x5b,0x5d,0x00, +0x04,0x63,0x61,0x6c,0x6c,0x00,0x04,0x70,0x75,0x73,0x68,0x3a,0x3a,0x00,0x00,0x00, +0xd4,0x53,0x43,0x00,0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00,0x00,0x00,0x1d,0x00, +0x80,0x00,0x48,0x01,0x00,0x02,0xc0,0x00,0x80,0x00,0x46,0x00,0x80,0x00,0x48,0x01, +0x00,0x04,0xc0,0x00,0x80,0x40,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x06,0xc0,0x00, +0x80,0x80,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x08,0xc0,0x00,0x80,0xc0,0x46,0x00, +0x80,0x00,0x48,0x01,0x00,0x0a,0xc0,0x00,0x81,0x00,0x46,0x00,0x80,0x00,0x48,0x01, +0x00,0x0c,0xc0,0x00,0x81,0x40,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x0e,0xc0,0x00, +0x81,0x80,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x10,0xc0,0x00,0x81,0xc0,0x46,0x00, +0x80,0x00,0x48,0x01,0x00,0x12,0xc0,0x00,0x82,0x00,0x46,0x00,0x00,0x00,0x05,0x00, +0x00,0x00,0x29,0x69,0x49,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x00, +0x09,0x65,0x61,0x63,0x68,0x5f,0x6c,0x69,0x6e,0x65,0x00,0x04,0x67,0x73,0x75,0x62, +0x00,0x05,0x67,0x73,0x75,0x62,0x21,0x00,0x04,0x73,0x63,0x61,0x6e,0x00,0x03,0x73, +0x75,0x62,0x00,0x04,0x73,0x75,0x62,0x21,0x00,0x09,0x65,0x61,0x63,0x68,0x5f,0x63, +0x68,0x61,0x72,0x00,0x09,0x65,0x61,0x63,0x68,0x5f,0x62,0x79,0x74,0x65,0x00,0x03, +0x5b,0x5d,0x3d,0xd3,0x19,0x00,0x00,0x00,0xd0,0x53,0x43,0x00,0x04,0x00,0x09,0x00, +0x02,0x0c,0x25,0x00,0x00,0x00,0x25,0x00,0x00,0x00,0xa6,0x01,0x3f,0xff,0x83,0x00, +0x40,0x06,0x17,0x02,0x00,0x40,0x01,0x02,0x80,0x00,0x06,0x03,0x00,0x80,0x01,0x03, +0x80,0xc0,0x01,0x03,0x80,0x80,0xad,0x04,0x00,0x80,0x01,0x03,0x80,0xc0,0xae,0x02, +0x80,0x41,0x20,0x02,0x00,0x00,0xa0,0x02,0x00,0xc0,0x01,0x02,0x00,0x80,0xad,0x01, +0x01,0x00,0x01,0x02,0x00,0x00,0x06,0x02,0xc0,0x04,0x83,0x03,0x00,0x80,0x01,0x02, +0x01,0x01,0x20,0x01,0x81,0x00,0x01,0x02,0x3f,0xf7,0x18,0x02,0x00,0x00,0x06,0x02, +0x01,0x40,0x20,0x02,0x80,0x80,0x01,0x02,0x01,0x80,0xb5,0x02,0x40,0x04,0x99,0x02, +0x00,0x40,0x01,0x02,0x80,0x00,0x06,0x03,0x00,0x80,0x01,0x03,0x80,0x00,0x06,0x03, +0x81,0x40,0x20,0x04,0x00,0x80,0x01,0x03,0x80,0xc0,0xae,0x02,0x80,0x41,0x20,0x02, +0x00,0x00,0xa0,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x29,0xde,0x8a,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x02,0x5b, +0x5d,0x00,0x01,0x2b,0x00,0x01,0x2d,0x00,0x05,0x69,0x6e,0x64,0x65,0x78,0x00,0x04, +0x73,0x69,0x7a,0x65,0x00,0x01,0x3e,0x3b,0xee,0x00,0x00,0x01,0x1c,0x53,0x43,0x00, +0x03,0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x1d,0x00,0x08,0x00,0xa6,0x01, +0x80,0x40,0x01,0x01,0x80,0x00,0x20,0x02,0x40,0x00,0x03,0x01,0x80,0x40,0xb2,0x01, +0xc0,0x00,0x99,0x01,0x80,0x80,0x01,0x01,0xc0,0x02,0x18,0x01,0x80,0x40,0x01,0x01, +0x80,0x00,0x20,0x02,0x40,0x00,0x83,0x01,0x80,0x40,0xb2,0x01,0xc0,0x00,0x99,0x00, +0x40,0x02,0x17,0x01,0x80,0x00,0x06,0x02,0x00,0x01,0x91,0x02,0x80,0x00,0x3d,0x01, +0x80,0x81,0x20,0x01,0x80,0x02,0x11,0x02,0x00,0x03,0x04,0x01,0x81,0x40,0xa0,0x01, +0xc0,0x01,0x19,0x01,0x80,0x00,0x05,0x00,0x40,0x02,0x17,0x01,0x80,0x00,0x06,0x02, +0x00,0x03,0x91,0x02,0x80,0x00,0xbd,0x01,0x80,0x81,0x20,0x01,0x80,0x00,0x29,0xe1, +0x20,0x00,0x00,0x00,0x02,0x11,0x00,0x19,0x77,0x72,0x6f,0x6e,0x67,0x20,0x6e,0x75, +0x6d,0x62,0x65,0x72,0x20,0x6f,0x66,0x20,0x61,0x72,0x67,0x75,0x6d,0x65,0x6e,0x74, +0x73,0x11,0x00,0x18,0x67,0x73,0x75,0x62,0x20,0x6e,0x6f,0x74,0x20,0x61,0x76,0x61, +0x69,0x6c,0x61,0x62,0x6c,0x65,0x20,0x28,0x79,0x65,0x74,0x29,0x70,0x08,0x00,0x00, +0x00,0x08,0x00,0x04,0x73,0x69,0x7a,0x65,0x00,0x02,0x3d,0x3d,0x00,0x05,0x72,0x61, +0x69,0x73,0x65,0x00,0x0d,0x41,0x72,0x67,0x75,0x6d,0x65,0x6e,0x74,0x45,0x72,0x72, +0x6f,0x72,0x00,0x06,0x4f,0x62,0x6a,0x65,0x63,0x74,0x00,0x0e,0x63,0x6f,0x6e,0x73, +0x74,0x5f,0x64,0x65,0x66,0x69,0x6e,0x65,0x64,0x3f,0x00,0x06,0x52,0x65,0x67,0x65, +0x78,0x70,0x00,0x13,0x4e,0x6f,0x74,0x49,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74, +0x65,0x64,0x45,0x72,0x72,0x6f,0x72,0xca,0xc5,0x00,0x00,0x00,0x7b,0x53,0x43,0x00, +0x04,0x00,0x07,0x00,0x02,0xed,0xeb,0x00,0x00,0x00,0x13,0x00,0x08,0x00,0xa6,0x02, +0x00,0x00,0x06,0x02,0x81,0x40,0x37,0x03,0x00,0x40,0x01,0x02,0x81,0x80,0x38,0x03, +0x00,0x80,0x01,0x02,0x00,0x3f,0xa1,0x01,0x81,0x00,0x01,0x02,0x00,0xc0,0x01,0x02, +0x80,0x00,0x06,0x02,0x00,0x40,0xa0,0x02,0x40,0x02,0x99,0x02,0x00,0x00,0x06,0x02, +0x80,0xc0,0x01,0x02,0x00,0x80,0xa0,0x02,0x00,0x00,0x06,0x00,0x40,0x00,0x97,0x02, +0x00,0x00,0x05,0x02,0x00,0x00,0x29,0x2f,0xb5,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x03,0x00,0x04,0x67,0x73,0x75,0x62,0x00,0x02,0x21,0x3d,0x00,0x07,0x72, +0x65,0x70,0x6c,0x61,0x63,0x65,0x59,0x55,0x00,0x00,0x00,0xa3,0x53,0x43,0x00,0x03, +0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x0c,0x02,0x00,0x00,0xa6,0x01,0x80, +0x00,0x11,0x02,0x00,0x01,0x04,0x01,0x80,0x40,0xa0,0x01,0xc0,0x01,0x19,0x01,0x80, +0x00,0x05,0x00,0x40,0x02,0x17,0x01,0x80,0x00,0x06,0x02,0x00,0x02,0x11,0x02,0x80, +0x00,0x3d,0x01,0x80,0xc1,0x20,0x01,0x80,0x00,0x29,0xab,0xa4,0x00,0x00,0x00,0x01, +0x11,0x00,0x18,0x73,0x63,0x61,0x6e,0x20,0x6e,0x6f,0x74,0x20,0x61,0x76,0x61,0x69, +0x6c,0x61,0x62,0x6c,0x65,0x20,0x28,0x79,0x65,0x74,0x29,0xb8,0x0d,0x00,0x00,0x00, +0x05,0x00,0x06,0x4f,0x62,0x6a,0x65,0x63,0x74,0x00,0x0e,0x63,0x6f,0x6e,0x73,0x74, +0x5f,0x64,0x65,0x66,0x69,0x6e,0x65,0x64,0x3f,0x00,0x06,0x52,0x65,0x67,0x65,0x78, +0x70,0x00,0x05,0x72,0x61,0x69,0x73,0x65,0x00,0x13,0x4e,0x6f,0x74,0x49,0x6d,0x70, +0x6c,0x65,0x6d,0x65,0x6e,0x74,0x65,0x64,0x45,0x72,0x72,0x6f,0x72,0xa5,0xea,0x00, +0x00,0x01,0x1b,0x53,0x43,0x00,0x03,0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00, +0x1d,0x00,0x08,0x00,0xa6,0x01,0x80,0x40,0x01,0x01,0x80,0x00,0x20,0x02,0x40,0x00, +0x03,0x01,0x80,0x40,0xb2,0x01,0xc0,0x00,0x99,0x01,0x80,0x80,0x01,0x01,0xc0,0x02, +0x18,0x01,0x80,0x40,0x01,0x01,0x80,0x00,0x20,0x02,0x40,0x00,0x83,0x01,0x80,0x40, +0xb2,0x01,0xc0,0x00,0x99,0x00,0x40,0x02,0x17,0x01,0x80,0x00,0x06,0x02,0x00,0x01, +0x91,0x02,0x80,0x00,0x3d,0x01,0x80,0x81,0x20,0x01,0x80,0x02,0x11,0x02,0x00,0x03, +0x04,0x01,0x81,0x40,0xa0,0x01,0xc0,0x01,0x19,0x01,0x80,0x00,0x05,0x00,0x40,0x02, +0x17,0x01,0x80,0x00,0x06,0x02,0x00,0x03,0x91,0x02,0x80,0x00,0xbd,0x01,0x80,0x81, +0x20,0x01,0x80,0x00,0x29,0xe1,0x20,0x00,0x00,0x00,0x02,0x11,0x00,0x19,0x77,0x72, +0x6f,0x6e,0x67,0x20,0x6e,0x75,0x6d,0x62,0x65,0x72,0x20,0x6f,0x66,0x20,0x61,0x72, +0x67,0x75,0x6d,0x65,0x6e,0x74,0x73,0x11,0x00,0x17,0x73,0x75,0x62,0x20,0x6e,0x6f, +0x74,0x20,0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65,0x20,0x28,0x79,0x65,0x74, +0x29,0xf7,0x53,0x00,0x00,0x00,0x08,0x00,0x04,0x73,0x69,0x7a,0x65,0x00,0x02,0x3d, +0x3d,0x00,0x05,0x72,0x61,0x69,0x73,0x65,0x00,0x0d,0x41,0x72,0x67,0x75,0x6d,0x65, +0x6e,0x74,0x45,0x72,0x72,0x6f,0x72,0x00,0x06,0x4f,0x62,0x6a,0x65,0x63,0x74,0x00, +0x0e,0x63,0x6f,0x6e,0x73,0x74,0x5f,0x64,0x65,0x66,0x69,0x6e,0x65,0x64,0x3f,0x00, +0x06,0x52,0x65,0x67,0x65,0x78,0x70,0x00,0x13,0x4e,0x6f,0x74,0x49,0x6d,0x70,0x6c, +0x65,0x6d,0x65,0x6e,0x74,0x65,0x64,0x45,0x72,0x72,0x6f,0x72,0xca,0xc5,0x00,0x00, +0x00,0x7a,0x53,0x43,0x00,0x04,0x00,0x07,0x00,0x02,0xed,0xeb,0x00,0x00,0x00,0x13, +0x00,0x08,0x00,0xa6,0x02,0x00,0x00,0x06,0x02,0x81,0x40,0x37,0x03,0x00,0x40,0x01, +0x02,0x81,0x80,0x38,0x03,0x00,0x80,0x01,0x02,0x00,0x3f,0xa1,0x01,0x81,0x00,0x01, +0x02,0x00,0xc0,0x01,0x02,0x80,0x00,0x06,0x02,0x00,0x40,0xa0,0x02,0x40,0x02,0x99, +0x02,0x00,0x00,0x06,0x02,0x80,0xc0,0x01,0x02,0x00,0x80,0xa0,0x02,0x00,0x00,0x06, +0x00,0x40,0x00,0x97,0x02,0x00,0x00,0x05,0x02,0x00,0x00,0x29,0x2f,0xb5,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x73,0x75,0x62,0x00,0x02,0x21, +0x3d,0x00,0x07,0x72,0x65,0x70,0x6c,0x61,0x63,0x65,0xc4,0x7c,0x00,0x00,0x00,0x7a, +0x53,0x43,0x00,0x03,0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x12,0x00,0x00, +0x00,0xa6,0x01,0x3f,0xff,0x83,0x00,0x40,0x04,0x17,0x01,0x80,0x40,0x01,0x02,0x00, +0x00,0x06,0x02,0x80,0x80,0x01,0x02,0x00,0x40,0xa0,0x01,0x80,0x00,0xa0,0x01,0x80, +0x80,0x01,0x01,0x80,0x80,0xad,0x01,0x00,0xc0,0x01,0x01,0x80,0x80,0x01,0x02,0x00, +0x00,0x06,0x02,0x01,0x00,0x20,0x01,0x80,0xc0,0xb3,0x01,0xbf,0xf9,0x98,0x00,0x00, +0x00,0x06,0x00,0x00,0x00,0x29,0xfe,0x64,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x05,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x02,0x5b,0x5d,0x00,0x01,0x2b,0x00, +0x01,0x3c,0x00,0x04,0x73,0x69,0x7a,0x65,0x36,0x2d,0x00,0x00,0x00,0x8d,0x53,0x43, +0x00,0x04,0x00,0x07,0x00,0x02,0xed,0xeb,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0xa6, +0x02,0x00,0x00,0x06,0x02,0x00,0x00,0x20,0x01,0x01,0x00,0x01,0x01,0xbf,0xff,0x83, +0x00,0x40,0x04,0x17,0x02,0x00,0x40,0x01,0x02,0x80,0x80,0x01,0x03,0x00,0xc0,0x01, +0x02,0x80,0x80,0xa0,0x02,0x00,0x40,0xa0,0x02,0x00,0xc0,0x01,0x02,0x00,0xc0,0xad, +0x01,0x81,0x00,0x01,0x02,0x00,0xc0,0x01,0x02,0x80,0x80,0x01,0x02,0x81,0x40,0x20, +0x02,0x01,0x00,0xb3,0x02,0x3f,0xf9,0x98,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x29, +0x79,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x05,0x62,0x79, +0x74,0x65,0x73,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x02,0x5b,0x5d,0x00,0x01,0x2b, +0x00,0x01,0x3c,0x00,0x04,0x73,0x69,0x7a,0x65,0x69,0xf7,0x00,0x00,0x00,0x8d,0x53, +0x43,0x00,0x06,0x00,0x0a,0x00,0x02,0x52,0x26,0x00,0x00,0x00,0x16,0x04,0x00,0x00, +0x26,0x03,0x00,0x00,0x06,0x03,0xbf,0xff,0x83,0x04,0x00,0x40,0x01,0x03,0x00,0x01, +0x20,0x02,0x01,0x80,0x01,0x03,0x00,0x00,0x06,0x03,0x80,0x40,0x01,0x03,0x80,0x40, +0xad,0x04,0x3f,0xff,0x03,0x03,0x81,0xc0,0x41,0x03,0x00,0x00,0xa0,0x02,0x81,0x80, +0x01,0x03,0x00,0x00,0x06,0x03,0x81,0x00,0x01,0x04,0x00,0x80,0x01,0x04,0x81,0x40, +0x01,0x03,0x81,0xc1,0xb7,0x04,0x00,0x00,0x3d,0x03,0x80,0xc0,0xa0,0x03,0x00,0x80, +0xa0,0x03,0x00,0x00,0x29,0xf2,0x1d,0x00,0x00,0x00,0x01,0x11,0x00,0x00,0x31,0x21, +0x00,0x00,0x00,0x04,0x00,0x02,0x5b,0x5d,0x00,0x01,0x2b,0x00,0x07,0x72,0x65,0x70, +0x6c,0x61,0x63,0x65,0x00,0x04,0x6a,0x6f,0x69,0x6e,0x15,0x8a,0x00,0x00,0x00,0x24, +0x53,0x43,0x00,0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00,0x00,0x00,0x02,0x00,0x00, +0x00,0x05,0x00,0x00,0x00,0x29,0x8b,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x53,0x43,0x00,0x01,0x00,0x03,0x00,0x02, +0x46,0x9f,0x00,0x00,0x00,0x04,0x00,0x80,0x00,0x06,0x01,0x00,0x00,0x91,0x00,0x80, +0x00,0xa0,0x01,0x00,0x00,0x29,0x38,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x02,0x00,0x07,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x00,0x0a,0x43,0x6f,0x6d, +0x70,0x61,0x72,0x61,0x62,0x6c,0x65,0x3a,0x13,0x00,0x00,0x00,0x83,0x53,0x43,0x00, +0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00,0x00,0x00,0x0e,0x00,0x80,0x00,0x48,0x01, +0x00,0x02,0xc0,0x00,0x80,0x00,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x08,0xc0,0x00, +0x80,0x40,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x0e,0xc0,0x00,0x80,0x80,0x46,0x00, +0x80,0x00,0x48,0x01,0x00,0x10,0xc0,0x00,0x80,0xc0,0x46,0x00,0x00,0x00,0x05,0x00, +0x00,0x00,0x29,0xd0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00, +0x0b,0x61,0x74,0x74,0x72,0x5f,0x72,0x65,0x61,0x64,0x65,0x72,0x00,0x0b,0x61,0x74, +0x74,0x72,0x5f,0x77,0x72,0x69,0x74,0x65,0x72,0x00,0x0d,0x61,0x74,0x74,0x72,0x5f, +0x61,0x63,0x63,0x65,0x73,0x73,0x6f,0x72,0x00,0x04,0x61,0x74,0x74,0x72,0x25,0xbc, +0x00,0x00,0x00,0x36,0x53,0x43,0x00,0x03,0x00,0x05,0x00,0x02,0x48,0x39,0x00,0x00, +0x00,0x05,0x00,0x08,0x00,0x26,0x01,0x80,0x40,0x01,0x02,0x00,0x03,0x40,0x01,0x80, +0x00,0x21,0x01,0x80,0x00,0x29,0x2e,0xa2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x01,0x00,0x04,0x65,0x61,0x63,0x68,0x9d,0xa1,0x00,0x00,0x00,0x70,0x53,0x43, +0x00,0x04,0x00,0x07,0x00,0x02,0xed,0xeb,0x00,0x00,0x00,0x0c,0x02,0x00,0x00,0x26, +0x02,0x00,0x00,0x3d,0x02,0x80,0x40,0x01,0x02,0x80,0x40,0x20,0x02,0x00,0x00,0xac, +0x02,0x00,0x80,0x20,0x01,0x81,0x00,0x01,0x02,0x00,0x00,0x06,0x02,0x80,0x40,0x01, +0x03,0x00,0x03,0x40,0x02,0x00,0xc0,0xa1,0x02,0x00,0x00,0x29,0xfa,0xd7,0x00,0x00, +0x00,0x01,0x11,0x00,0x01,0x40,0x06,0x32,0x00,0x00,0x00,0x04,0x00,0x01,0x2b,0x00, +0x04,0x74,0x6f,0x5f,0x73,0x00,0x06,0x69,0x6e,0x74,0x65,0x72,0x6e,0x00,0x0d,0x64, +0x65,0x66,0x69,0x6e,0x65,0x5f,0x6d,0x65,0x74,0x68,0x6f,0x64,0x27,0x4e,0x00,0x00, +0x00,0x43,0x53,0x43,0x00,0x01,0x00,0x03,0x00,0x02,0x46,0x9f,0x00,0x00,0x00,0x04, +0x00,0x80,0x00,0x06,0x01,0x00,0xc0,0x15,0x00,0x80,0x00,0xa0,0x00,0x80,0x00,0x29, +0xfb,0xc3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x15,0x69,0x6e, +0x73,0x74,0x61,0x6e,0x63,0x65,0x5f,0x76,0x61,0x72,0x69,0x61,0x62,0x6c,0x65,0x5f, +0x67,0x65,0x74,0x79,0x63,0x00,0x00,0x00,0x36,0x53,0x43,0x00,0x03,0x00,0x05,0x00, +0x02,0x48,0x39,0x00,0x00,0x00,0x05,0x00,0x08,0x00,0x26,0x01,0x80,0x40,0x01,0x02, +0x00,0x03,0x40,0x01,0x80,0x00,0x21,0x01,0x80,0x00,0x29,0x2e,0xa2,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x65,0x61,0x63,0x68,0x9d,0xa1,0x00, +0x00,0x00,0x8c,0x53,0x43,0x00,0x04,0x00,0x07,0x00,0x02,0xed,0xeb,0x00,0x00,0x00, +0x12,0x02,0x00,0x00,0x26,0x02,0x00,0x00,0x3d,0x02,0x80,0x40,0x01,0x02,0x80,0x40, +0x20,0x02,0x00,0x00,0xac,0x02,0x00,0x80,0x20,0x01,0x81,0x00,0x01,0x02,0x00,0x40, +0x01,0x02,0x00,0x40,0x20,0x02,0x80,0x00,0xbd,0x02,0x00,0x00,0xac,0x02,0x00,0x80, +0x20,0x00,0x81,0x00,0x01,0x02,0x00,0x00,0x06,0x02,0x80,0x40,0x01,0x03,0x00,0x03, +0x40,0x02,0x00,0xc0,0xa1,0x02,0x00,0x00,0x29,0x4f,0x42,0x00,0x00,0x00,0x02,0x11, +0x00,0x01,0x40,0x11,0x00,0x01,0x3d,0x65,0xa1,0x00,0x00,0x00,0x04,0x00,0x01,0x2b, +0x00,0x04,0x74,0x6f,0x5f,0x73,0x00,0x06,0x69,0x6e,0x74,0x65,0x72,0x6e,0x00,0x0d, +0x64,0x65,0x66,0x69,0x6e,0x65,0x5f,0x6d,0x65,0x74,0x68,0x6f,0x64,0x27,0x4e,0x00, +0x00,0x00,0x4b,0x53,0x43,0x00,0x03,0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00, +0x06,0x02,0x00,0x00,0x26,0x01,0x80,0x00,0x06,0x02,0x00,0xc0,0x15,0x02,0x80,0x40, +0x01,0x01,0x80,0x01,0x20,0x01,0x80,0x00,0x29,0x80,0x48,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x01,0x00,0x15,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x5f, +0x76,0x61,0x72,0x69,0x61,0x62,0x6c,0x65,0x5f,0x73,0x65,0x74,0x2b,0xd6,0x00,0x00, +0x00,0x66,0x53,0x43,0x00,0x03,0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x0c, +0x00,0x08,0x00,0x26,0x01,0x80,0x00,0x06,0x02,0x01,0x00,0x37,0x02,0x80,0x40,0x01, +0x02,0x01,0x40,0x38,0x01,0x80,0x3f,0xa0,0x01,0x80,0x00,0x06,0x02,0x01,0x00,0x37, +0x02,0x80,0x40,0x01,0x02,0x01,0x40,0x38,0x01,0x80,0x7f,0xa0,0x01,0x80,0x00,0x29, +0xad,0x8c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x0b,0x61,0x74, +0x74,0x72,0x5f,0x72,0x65,0x61,0x64,0x65,0x72,0x00,0x0b,0x61,0x74,0x74,0x72,0x5f, +0x77,0x72,0x69,0x74,0x65,0x72,0x6f,0x79,0x00,0x00,0x00,0x3d,0x53,0x43,0x00,0x03, +0x00,0x05,0x00,0x02,0x48,0x39,0x00,0x00,0x00,0x05,0x02,0x00,0x00,0x26,0x01,0x80, +0x00,0x06,0x02,0x00,0x40,0x01,0x01,0x80,0x00,0xa0,0x01,0x80,0x00,0x29,0xfa,0x4e, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x0b,0x61,0x74,0x74,0x72, +0x5f,0x72,0x65,0x61,0x64,0x65,0x72,0x01,0xeb,0x00,0x00,0x00,0x36,0x53,0x43,0x00, +0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00,0x00,0x00,0x05,0x00,0x80,0x00,0x48,0x01, +0x00,0x02,0xc0,0x00,0x80,0x00,0x46,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x29,0xf3, +0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x65,0x61,0x63, +0x68,0x9d,0xa1,0x00,0x00,0x01,0x35,0x53,0x43,0x00,0x04,0x00,0x07,0x00,0x02,0xed, +0xeb,0x00,0x00,0x00,0x2e,0x00,0x00,0x00,0xa6,0x02,0x00,0x00,0x06,0x02,0x00,0x00, +0x20,0x01,0x01,0x00,0x01,0x02,0x00,0x80,0x01,0x02,0x80,0x01,0x04,0x02,0x00,0x40, +0xa0,0x02,0x40,0x00,0x99,0x00,0x40,0x02,0x17,0x02,0x00,0x00,0x06,0x02,0x80,0x02, +0x11,0x03,0x00,0x00,0x3d,0x02,0x00,0xc1,0x20,0x02,0x00,0x00,0x06,0x02,0x01,0x40, +0x20,0x01,0x81,0x00,0x01,0x02,0x00,0x80,0x01,0x02,0x80,0xc0,0x01,0x02,0x01,0x80, +0xa0,0x02,0xbf,0xff,0x83,0x02,0x01,0xc0,0xb5,0x02,0x40,0x01,0x19,0x00,0x00,0x00, +0x06,0x00,0x00,0x00,0x29,0x00,0x40,0x03,0x17,0x02,0x80,0x40,0x01,0x03,0x00,0x80, +0x01,0x02,0x82,0x00,0xa0,0x02,0x80,0x80,0x01,0x02,0x80,0x80,0x20,0x01,0x01,0x40, +0x01,0x02,0x80,0x80,0x01,0x03,0x00,0xc0,0x01,0x02,0x81,0x80,0xa0,0x03,0x3f,0xff, +0x83,0x02,0x82,0x40,0xb3,0x02,0xbf,0xfa,0x18,0x02,0x80,0x00,0x06,0x02,0x82,0x80, +0x20,0x02,0xc0,0x00,0x99,0x00,0x40,0x01,0x97,0x02,0x80,0x40,0x01,0x03,0x00,0x80, +0x01,0x02,0x82,0x00,0xa0,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x29,0xe0,0xef,0x00, +0x00,0x00,0x01,0x11,0x00,0x0d,0x63,0x61,0x6e,0x27,0x74,0x20,0x69,0x74,0x65,0x72, +0x61,0x74,0x65,0xdc,0x8f,0x00,0x00,0x00,0x0b,0x00,0x05,0x66,0x69,0x72,0x73,0x74, +0x00,0x0b,0x72,0x65,0x73,0x70,0x6f,0x6e,0x64,0x5f,0x74,0x6f,0x3f,0x00,0x04,0x73, +0x75,0x63,0x63,0x00,0x05,0x72,0x61,0x69,0x73,0x65,0x00,0x09,0x54,0x79,0x70,0x65, +0x45,0x72,0x72,0x6f,0x72,0x00,0x04,0x6c,0x61,0x73,0x74,0x00,0x03,0x3c,0x3d,0x3e, +0x00,0x01,0x3e,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x01,0x3c,0x00,0x0c,0x65,0x78, +0x63,0x6c,0x75,0x64,0x65,0x5f,0x65,0x6e,0x64,0x3f,0x47,0x7b,0x00,0x00,0x00,0x24, +0x53,0x43,0x00,0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00,0x00,0x00,0x02,0x00,0x00, +0x00,0x05,0x00,0x00,0x00,0x29,0x8b,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x53,0x43,0x00,0x01,0x00,0x03,0x00,0x02, +0x46,0x9f,0x00,0x00,0x00,0x04,0x00,0x80,0x00,0x06,0x01,0x00,0x00,0x91,0x00,0x80, +0x00,0xa0,0x01,0x00,0x00,0x29,0x38,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x02,0x00,0x07,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x00,0x0a,0x45,0x6e,0x75, +0x6d,0x65,0x72,0x61,0x62,0x6c,0x65,0xfa,0xae,0x00,0x00,0x00,0x6f,0x53,0x43,0x00, +0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00,0x00,0x00,0x0e,0x00,0x80,0x00,0x48,0x01, +0x00,0x02,0xc0,0x00,0x80,0x00,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x04,0xc0,0x00, +0x80,0x40,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x06,0xc0,0x00,0x80,0x80,0x46,0x00, +0x80,0x00,0x48,0x01,0x00,0x08,0xc0,0x00,0x80,0xc0,0x46,0x00,0x00,0x00,0x05,0x00, +0x00,0x00,0x29,0xab,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00, +0x06,0x64,0x6f,0x77,0x6e,0x74,0x6f,0x00,0x05,0x74,0x69,0x6d,0x65,0x73,0x00,0x04, +0x75,0x70,0x74,0x6f,0x00,0x04,0x73,0x74,0x65,0x70,0xf1,0x87,0x00,0x00,0x00,0x65, +0x53,0x43,0x00,0x04,0x00,0x06,0x00,0x02,0xfd,0xca,0x00,0x00,0x00,0x0f,0x02,0x00, +0x00,0xa6,0x01,0x80,0x00,0x06,0x00,0x40,0x03,0x17,0x02,0x00,0x80,0x01,0x02,0x80, +0xc0,0x01,0x02,0x00,0x00,0xa0,0x02,0x00,0xc0,0x01,0x02,0x00,0x40,0xaf,0x01,0x81, +0x00,0x01,0x02,0x00,0xc0,0x01,0x02,0x80,0x40,0x01,0x02,0x00,0x80,0xb6,0x02,0x3f, +0xfb,0x18,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x29,0x45,0x82,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x01,0x2d,0x00, +0x02,0x3e,0x3d,0xae,0x76,0x00,0x00,0x00,0x64,0x53,0x43,0x00,0x03,0x00,0x05,0x00, +0x02,0x48,0x39,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0xa6,0x01,0x3f,0xff,0x83,0x00, +0x40,0x03,0x17,0x01,0x80,0x40,0x01,0x02,0x00,0x80,0x01,0x01,0x80,0x00,0xa0,0x01, +0x80,0x80,0x01,0x01,0x80,0x40,0xad,0x01,0x00,0xc0,0x01,0x01,0x80,0x80,0x01,0x02, +0x00,0x00,0x06,0x01,0x80,0x80,0xb3,0x01,0xbf,0xfb,0x18,0x00,0x00,0x00,0x06,0x00, +0x00,0x00,0x29,0xab,0xb1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00, +0x04,0x63,0x61,0x6c,0x6c,0x00,0x01,0x2b,0x00,0x01,0x3c,0x80,0xbf,0x00,0x00,0x00, +0x65,0x53,0x43,0x00,0x04,0x00,0x06,0x00,0x02,0xfd,0xca,0x00,0x00,0x00,0x0f,0x02, +0x00,0x00,0xa6,0x01,0x80,0x00,0x06,0x00,0x40,0x03,0x17,0x02,0x00,0x80,0x01,0x02, +0x80,0xc0,0x01,0x02,0x00,0x00,0xa0,0x02,0x00,0xc0,0x01,0x02,0x00,0x40,0xad,0x01, +0x81,0x00,0x01,0x02,0x00,0xc0,0x01,0x02,0x80,0x40,0x01,0x02,0x00,0x80,0xb4,0x02, +0x3f,0xfb,0x18,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x29,0xcf,0xfd,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x01,0x2b, +0x00,0x02,0x3c,0x3d,0x1e,0xd6,0x00,0x00,0x00,0xac,0x53,0x43,0x00,0x05,0x00,0x07, +0x00,0x02,0xda,0xdb,0x00,0x00,0x00,0x1b,0x02,0x10,0x00,0xa6,0x00,0x40,0x00,0x97, +0x00,0x40,0x00,0x97,0x01,0x40,0x00,0x03,0x02,0x80,0x40,0x01,0x03,0x00,0x00,0x91, +0x02,0x80,0x00,0xa0,0x02,0xc0,0x01,0x99,0x02,0x80,0x00,0x06,0x02,0x80,0x80,0x20, +0x00,0x40,0x00,0x97,0x02,0x80,0x00,0x06,0x02,0x01,0x40,0x01,0x00,0x40,0x03,0x97, +0x02,0x80,0xc0,0x01,0x03,0x01,0x00,0x01,0x02,0x80,0xc0,0xa0,0x02,0x81,0x00,0x01, +0x03,0x00,0x80,0x01,0x02,0x81,0x00,0xac,0x02,0x01,0x40,0x01,0x02,0x81,0x00,0x01, +0x03,0x00,0x40,0x01,0x02,0x81,0x40,0xb4,0x02,0xbf,0xfa,0x98,0x00,0x00,0x00,0x06, +0x00,0x00,0x00,0x29,0x62,0x6a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06, +0x00,0x08,0x6b,0x69,0x6e,0x64,0x5f,0x6f,0x66,0x3f,0x00,0x05,0x46,0x6c,0x6f,0x61, +0x74,0x00,0x04,0x74,0x6f,0x5f,0x66,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x01,0x2b, +0x00,0x02,0x3c,0x3d,0xd2,0x95,0x00,0x00,0x00,0x24,0x53,0x43,0x00,0x01,0x00,0x02, +0x00,0x02,0x56,0xbe,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x29, +0x8b,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x41,0x53,0x43,0x00,0x01,0x00,0x03,0x00,0x02,0x46,0x9f,0x00,0x00,0x00,0x04, +0x00,0x80,0x00,0x06,0x01,0x00,0x00,0x91,0x00,0x80,0x00,0xa0,0x01,0x00,0x00,0x29, +0x38,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x07,0x69,0x6e, +0x63,0x6c,0x75,0x64,0x65,0x00,0x0a,0x43,0x6f,0x6d,0x70,0x61,0x72,0x61,0x62,0x6c, +0x65,0x3a,0x13,0x00,0x00,0x00,0x88,0x53,0x43,0x00,0x01,0x00,0x02,0x00,0x02,0x56, +0xbe,0x00,0x00,0x00,0x14,0x00,0x80,0x00,0x48,0x01,0x00,0x02,0xc0,0x00,0x80,0x00, +0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x04,0xc0,0x00,0x80,0x40,0x46,0x00,0x80,0x00, +0x48,0x01,0x00,0x06,0xc0,0x00,0x80,0x80,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x08, +0xc0,0x00,0x80,0xc0,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x0a,0xc0,0x00,0x81,0x00, +0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x0c,0xc0,0x00,0x81,0x40,0x46,0x00,0x00,0x00, +0x05,0x00,0x00,0x00,0x29,0xec,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x06,0x00,0x01,0x3c,0x00,0x02,0x3c,0x3d,0x00,0x02,0x3d,0x3d,0x00,0x01,0x3e,0x00, +0x02,0x3e,0x3d,0x00,0x08,0x62,0x65,0x74,0x77,0x65,0x65,0x6e,0x3f,0x93,0xaf,0x00, +0x00,0x00,0x72,0x53,0x43,0x00,0x04,0x00,0x06,0x00,0x02,0xfd,0xca,0x00,0x00,0x00, +0x12,0x02,0x00,0x00,0x26,0x02,0x00,0x00,0x06,0x02,0x80,0x40,0x01,0x02,0x00,0x00, +0xa0,0x01,0x81,0x00,0x01,0x02,0x00,0xc0,0x01,0x02,0x00,0x40,0x20,0x02,0x40,0x01, +0x19,0x02,0x00,0x00,0x08,0x00,0x40,0x03,0x97,0x02,0x00,0xc0,0x01,0x02,0xbf,0xff, +0x83,0x02,0x00,0x80,0xb3,0x02,0x40,0x01,0x19,0x02,0x00,0x00,0x07,0x00,0x40,0x00, +0x97,0x02,0x00,0x00,0x08,0x02,0x00,0x00,0x29,0x07,0xbe,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x3c,0x3d,0x3e,0x00,0x04,0x6e,0x69,0x6c,0x3f, +0x00,0x01,0x3c,0x0f,0xab,0x00,0x00,0x00,0x73,0x53,0x43,0x00,0x04,0x00,0x06,0x00, +0x02,0xfd,0xca,0x00,0x00,0x00,0x12,0x02,0x00,0x00,0x26,0x02,0x00,0x00,0x06,0x02, +0x80,0x40,0x01,0x02,0x00,0x00,0xa0,0x01,0x81,0x00,0x01,0x02,0x00,0xc0,0x01,0x02, +0x00,0x40,0x20,0x02,0x40,0x01,0x19,0x02,0x00,0x00,0x08,0x00,0x40,0x03,0x97,0x02, +0x00,0xc0,0x01,0x02,0xbf,0xff,0x83,0x02,0x00,0x80,0xb4,0x02,0x40,0x01,0x19,0x02, +0x00,0x00,0x07,0x00,0x40,0x00,0x97,0x02,0x00,0x00,0x08,0x02,0x00,0x00,0x29,0x3d, +0xa1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x3c,0x3d,0x3e, +0x00,0x04,0x6e,0x69,0x6c,0x3f,0x00,0x02,0x3c,0x3d,0x6a,0xb1,0x00,0x00,0x00,0x59, +0x53,0x43,0x00,0x04,0x00,0x06,0x00,0x02,0xfd,0xca,0x00,0x00,0x00,0x0d,0x02,0x00, +0x00,0x26,0x02,0x00,0x00,0x06,0x02,0x80,0x40,0x01,0x02,0x00,0x00,0xa0,0x01,0x81, +0x00,0x01,0x02,0x00,0xc0,0x01,0x02,0xbf,0xff,0x83,0x02,0x00,0x40,0xb2,0x02,0x40, +0x01,0x19,0x02,0x00,0x00,0x07,0x00,0x40,0x00,0x97,0x02,0x00,0x00,0x08,0x02,0x00, +0x00,0x29,0x42,0xcf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x03, +0x3c,0x3d,0x3e,0x00,0x02,0x3d,0x3d,0x10,0x37,0x00,0x00,0x00,0x72,0x53,0x43,0x00, +0x04,0x00,0x06,0x00,0x02,0xfd,0xca,0x00,0x00,0x00,0x12,0x02,0x00,0x00,0x26,0x02, +0x00,0x00,0x06,0x02,0x80,0x40,0x01,0x02,0x00,0x00,0xa0,0x01,0x81,0x00,0x01,0x02, +0x00,0xc0,0x01,0x02,0x00,0x40,0x20,0x02,0x40,0x01,0x19,0x02,0x00,0x00,0x08,0x00, +0x40,0x03,0x97,0x02,0x00,0xc0,0x01,0x02,0xbf,0xff,0x83,0x02,0x00,0x80,0xb5,0x02, +0x40,0x01,0x19,0x02,0x00,0x00,0x07,0x00,0x40,0x00,0x97,0x02,0x00,0x00,0x08,0x02, +0x00,0x00,0x29,0xe3,0xbe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00, +0x03,0x3c,0x3d,0x3e,0x00,0x04,0x6e,0x69,0x6c,0x3f,0x00,0x01,0x3e,0x0f,0xa9,0x00, +0x00,0x00,0x73,0x53,0x43,0x00,0x04,0x00,0x06,0x00,0x02,0xfd,0xca,0x00,0x00,0x00, +0x12,0x02,0x00,0x00,0x26,0x02,0x00,0x00,0x06,0x02,0x80,0x40,0x01,0x02,0x00,0x00, +0xa0,0x01,0x81,0x00,0x01,0x02,0x00,0xc0,0x01,0x02,0x00,0x40,0x20,0x02,0x40,0x01, +0x19,0x02,0x00,0x00,0x08,0x00,0x40,0x03,0x97,0x02,0x00,0xc0,0x01,0x02,0xbf,0xff, +0x83,0x02,0x00,0x80,0xb6,0x02,0x40,0x01,0x19,0x02,0x00,0x00,0x07,0x00,0x40,0x00, +0x97,0x02,0x00,0x00,0x08,0x02,0x00,0x00,0x29,0x91,0xbe,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x3c,0x3d,0x3e,0x00,0x04,0x6e,0x69,0x6c,0x3f, +0x00,0x02,0x3e,0x3d,0x68,0xb1,0x00,0x00,0x00,0x56,0x53,0x43,0x00,0x04,0x00,0x06, +0x00,0x02,0xfd,0xca,0x00,0x00,0x00,0x0d,0x04,0x00,0x00,0x26,0x02,0x00,0x00,0x06, +0x02,0x80,0x40,0x01,0x02,0x00,0x00,0xb3,0x02,0x40,0x01,0x98,0x02,0x00,0x00,0x06, +0x02,0x80,0x80,0x01,0x02,0x00,0x40,0xb5,0x02,0x40,0x01,0x19,0x02,0x00,0x00,0x08, +0x00,0x40,0x00,0x97,0x02,0x00,0x00,0x07,0x02,0x00,0x00,0x29,0xd7,0xe2,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x01,0x3c,0x00,0x01,0x3e,0x32,0x75, +0x00,0x00,0x00,0xf5,0x53,0x43,0x00,0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00,0x00, +0x00,0x20,0x00,0x80,0x00,0x48,0x01,0x00,0x02,0xc0,0x00,0x80,0x00,0x46,0x00,0x80, +0x00,0x48,0x01,0x00,0x04,0xc0,0x00,0x80,0x40,0x46,0x00,0x80,0x00,0x48,0x01,0x00, +0x08,0xc0,0x00,0x80,0x80,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x0c,0xc0,0x00,0x80, +0xc0,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x10,0xc0,0x00,0x81,0x00,0x46,0x00,0x80, +0x00,0x48,0x01,0x00,0x12,0xc0,0x00,0x81,0x40,0x46,0x00,0x80,0x00,0x48,0x01,0x00, +0x1a,0xc0,0x00,0x81,0x80,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x20,0xc0,0x00,0x81, +0xc0,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x24,0xc0,0x00,0x82,0x00,0x46,0x00,0x80, +0x00,0x48,0x01,0x00,0x2a,0xc0,0x00,0x82,0x40,0x46,0x00,0x00,0x00,0x05,0x00,0x00, +0x00,0x29,0x88,0xbb,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x06, +0x64,0x65,0x6c,0x65,0x74,0x65,0x00,0x04,0x65,0x61,0x63,0x68,0x00,0x08,0x65,0x61, +0x63,0x68,0x5f,0x6b,0x65,0x79,0x00,0x0a,0x65,0x61,0x63,0x68,0x5f,0x76,0x61,0x6c, +0x75,0x65,0x00,0x0a,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x69,0x7a,0x65,0x00,0x05, +0x6d,0x65,0x72,0x67,0x65,0x00,0x07,0x72,0x65,0x6a,0x65,0x63,0x74,0x21,0x00,0x06, +0x72,0x65,0x6a,0x65,0x63,0x74,0x00,0x07,0x73,0x65,0x6c,0x65,0x63,0x74,0x21,0x00, +0x06,0x73,0x65,0x6c,0x65,0x63,0x74,0xb0,0x41,0x00,0x00,0x00,0x79,0x53,0x43,0x00, +0x03,0x00,0x05,0x00,0x02,0x48,0x39,0x00,0x00,0x00,0x10,0x02,0x00,0x00,0xa6,0x01, +0x80,0x80,0x01,0x01,0xc0,0x02,0x19,0x01,0x80,0x00,0x06,0x02,0x00,0x40,0x01,0x01, +0x80,0x00,0xa0,0x01,0x80,0x40,0x20,0x01,0xc0,0x02,0x19,0x01,0x80,0x80,0x01,0x02, +0x00,0x40,0x01,0x01,0x80,0x80,0xa0,0x00,0x40,0x01,0x97,0x01,0x80,0x00,0x06,0x02, +0x00,0x40,0x01,0x01,0x80,0xc0,0xa0,0x01,0x80,0x00,0x29,0xf6,0x9a,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x08,0x68,0x61,0x73,0x5f,0x6b,0x65,0x79, +0x3f,0x00,0x01,0x21,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x08,0x5f,0x5f,0x64,0x65, +0x6c,0x65,0x74,0x65,0xe1,0x56,0x00,0x00,0x00,0x44,0x53,0x43,0x00,0x02,0x00,0x04, +0x00,0x02,0x6f,0x28,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0xa6,0x01,0x00,0x00,0x06, +0x01,0x00,0x00,0x20,0x01,0x80,0x03,0x40,0x01,0x00,0x40,0x21,0x00,0x00,0x00,0x06, +0x00,0x00,0x00,0x29,0x41,0xa9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02, +0x00,0x04,0x6b,0x65,0x79,0x73,0x00,0x04,0x65,0x61,0x63,0x68,0x64,0x2c,0x00,0x00, +0x00,0x4a,0x53,0x43,0x00,0x03,0x00,0x07,0x00,0x02,0x68,0x7b,0x00,0x00,0x00,0x09, +0x02,0x00,0x00,0x26,0x01,0x80,0x40,0x15,0x02,0x00,0x40,0x01,0x02,0x80,0x00,0x06, +0x03,0x00,0x40,0x01,0x02,0x80,0x40,0xa0,0x02,0x01,0x01,0x37,0x01,0x80,0x00,0xa0, +0x01,0x80,0x00,0x29,0x42,0x64,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02, +0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x02,0x5b,0x5d,0xa6,0x21,0x00,0x00,0x00,0x44, +0x53,0x43,0x00,0x02,0x00,0x04,0x00,0x02,0x6f,0x28,0x00,0x00,0x00,0x07,0x00,0x00, +0x00,0xa6,0x01,0x00,0x00,0x06,0x01,0x00,0x00,0x20,0x01,0x80,0x03,0x40,0x01,0x00, +0x40,0x21,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x29,0x41,0xa9,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x04,0x6b,0x65,0x79,0x73,0x00,0x04,0x65,0x61, +0x63,0x68,0x64,0x2c,0x00,0x00,0x00,0x36,0x53,0x43,0x00,0x03,0x00,0x05,0x00,0x02, +0x48,0x39,0x00,0x00,0x00,0x05,0x02,0x00,0x00,0x26,0x01,0x80,0x40,0x15,0x02,0x00, +0x40,0x01,0x01,0x80,0x00,0xa0,0x01,0x80,0x00,0x29,0x0a,0xc9,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x63,0x61,0x6c,0x6c,0x38,0x03,0x00,0x00, +0x00,0x44,0x53,0x43,0x00,0x02,0x00,0x04,0x00,0x02,0x6f,0x28,0x00,0x00,0x00,0x07, +0x00,0x00,0x00,0xa6,0x01,0x00,0x00,0x06,0x01,0x00,0x00,0x20,0x01,0x80,0x03,0x40, +0x01,0x00,0x40,0x21,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x29,0x41,0xa9,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x04,0x6b,0x65,0x79,0x73,0x00,0x04, +0x65,0x61,0x63,0x68,0x64,0x2c,0x00,0x00,0x00,0x42,0x53,0x43,0x00,0x03,0x00,0x06, +0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x07,0x02,0x00,0x00,0x26,0x01,0x80,0x40,0x15, +0x02,0x00,0x00,0x06,0x02,0x80,0x40,0x01,0x02,0x00,0x40,0xa0,0x01,0x80,0x00,0xa0, +0x01,0x80,0x00,0x29,0xb9,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02, +0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x02,0x5b,0x5d,0xa6,0x21,0x00,0x00,0x00,0x49, +0x53,0x43,0x00,0x03,0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x08,0x00,0x08, +0x00,0xa6,0x01,0x80,0x00,0x06,0x02,0x00,0x80,0x01,0x02,0x01,0x00,0xb7,0x02,0x80, +0x40,0x01,0x02,0x01,0x40,0x38,0x01,0x80,0x3f,0xa0,0x01,0x80,0x00,0x29,0xa4,0x7a, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x0b,0x5f,0x5f,0x69,0x6e, +0x69,0x74,0x5f,0x63,0x6f,0x72,0x65,0xc3,0xc7,0x00,0x00,0x00,0xce,0x53,0x43,0x00, +0x04,0x00,0x06,0x00,0x02,0xfd,0xca,0x00,0x00,0x00,0x1a,0x02,0x00,0x00,0xa6,0x01, +0x81,0x00,0x3f,0x02,0x00,0x40,0x01,0x02,0x80,0x00,0x84,0x02,0x00,0x00,0xa0,0x02, +0x40,0x00,0x99,0x00,0x40,0x01,0x97,0x02,0x00,0x00,0x06,0x02,0x80,0x00,0x3d,0x02, +0x00,0x80,0xa0,0x02,0x00,0x40,0x01,0x02,0x00,0x40,0x20,0x00,0x81,0x00,0x01,0x02, +0x00,0x00,0x06,0x02,0x80,0x03,0x40,0x02,0x00,0xc0,0x21,0x02,0x00,0x80,0x01,0x02, +0x40,0x02,0x19,0x02,0x00,0x40,0x01,0x02,0x80,0x05,0x40,0x02,0x00,0xc0,0x21,0x00, +0x40,0x01,0x97,0x02,0x00,0x40,0x01,0x02,0x80,0x07,0x40,0x02,0x00,0xc0,0x21,0x01, +0x80,0x00,0x29,0x5c,0xc0,0x00,0x00,0x00,0x01,0x11,0x00,0x20,0x63,0x61,0x6e,0x27, +0x74,0x20,0x63,0x6f,0x6e,0x76,0x65,0x72,0x74,0x20,0x61,0x72,0x67,0x75,0x6d,0x65, +0x6e,0x74,0x20,0x69,0x6e,0x74,0x6f,0x20,0x48,0x61,0x73,0x68,0x62,0xc0,0x00,0x00, +0x00,0x04,0x00,0x0b,0x72,0x65,0x73,0x70,0x6f,0x6e,0x64,0x5f,0x74,0x6f,0x3f,0x00, +0x07,0x74,0x6f,0x5f,0x68,0x61,0x73,0x68,0x00,0x05,0x72,0x61,0x69,0x73,0x65,0x00, +0x08,0x65,0x61,0x63,0x68,0x5f,0x6b,0x65,0x79,0x18,0xa0,0x00,0x00,0x00,0x49,0x53, +0x43,0x00,0x03,0x00,0x07,0x00,0x02,0x68,0x7b,0x00,0x00,0x00,0x09,0x02,0x00,0x00, +0x26,0x01,0x80,0x00,0x06,0x02,0x00,0x40,0x01,0x01,0x80,0x00,0xa0,0x02,0x00,0xc0, +0x15,0x02,0x80,0x40,0x01,0x03,0x00,0xc0,0x01,0x02,0x00,0x41,0x20,0x01,0x80,0x00, +0x29,0x06,0x52,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x5b, +0x5d,0x00,0x03,0x5b,0x5d,0x3d,0x52,0x66,0x00,0x00,0x00,0x91,0x53,0x43,0x00,0x03, +0x00,0x08,0x00,0x02,0x99,0x94,0x00,0x00,0x00,0x17,0x02,0x00,0x00,0x26,0x01,0x80, +0x00,0x06,0x02,0x00,0x40,0x01,0x01,0x80,0x00,0xa0,0x01,0xc0,0x05,0x19,0x01,0x80, +0x80,0x15,0x02,0x00,0x40,0x01,0x02,0x80,0x00,0x06,0x03,0x00,0x40,0x01,0x02,0x80, +0x80,0xa0,0x03,0x00,0x40,0x15,0x03,0x80,0x40,0x01,0x03,0x00,0x80,0xa0,0x01,0x80, +0x41,0xa0,0x00,0x40,0x01,0x97,0x01,0x80,0x40,0x15,0x02,0x00,0x40,0x01,0x01,0x80, +0x80,0xa0,0x02,0x00,0xc0,0x15,0x02,0x80,0x40,0x01,0x03,0x00,0xc0,0x01,0x02,0x00, +0xc1,0x20,0x01,0x80,0x00,0x29,0x5c,0x51,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x04,0x00,0x08,0x68,0x61,0x73,0x5f,0x6b,0x65,0x79,0x3f,0x00,0x04,0x63,0x61, +0x6c,0x6c,0x00,0x02,0x5b,0x5d,0x00,0x03,0x5b,0x5d,0x3d,0xfd,0x8d,0x00,0x00,0x00, +0x49,0x53,0x43,0x00,0x03,0x00,0x07,0x00,0x02,0x68,0x7b,0x00,0x00,0x00,0x09,0x02, +0x00,0x00,0x26,0x01,0x80,0x40,0x15,0x02,0x00,0x40,0x01,0x01,0x80,0x00,0xa0,0x02, +0x00,0xc0,0x15,0x02,0x80,0x40,0x01,0x03,0x00,0xc0,0x01,0x02,0x00,0x41,0x20,0x01, +0x80,0x00,0x29,0xcb,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00, +0x02,0x5b,0x5d,0x00,0x03,0x5b,0x5d,0x3d,0x52,0x66,0x00,0x00,0x00,0x7a,0x53,0x43, +0x00,0x03,0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0xa6, +0x01,0x00,0xc0,0x37,0x01,0x80,0x00,0x06,0x02,0x00,0x03,0x40,0x01,0x80,0x00,0x21, +0x01,0x80,0x80,0x01,0x01,0x80,0x40,0x20,0x02,0x3f,0xff,0x83,0x01,0x80,0x80,0xb2, +0x01,0xc0,0x01,0x19,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x29,0x02,0x00,0x80,0x01, +0x02,0x80,0x05,0x40,0x02,0x00,0xc0,0x21,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x29, +0x7f,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x08,0x65,0x61, +0x63,0x68,0x5f,0x6b,0x65,0x79,0x00,0x04,0x73,0x69,0x7a,0x65,0x00,0x02,0x3d,0x3d, +0x00,0x04,0x65,0x61,0x63,0x68,0x0b,0x74,0x00,0x00,0x00,0x68,0x53,0x43,0x00,0x04, +0x00,0x07,0x00,0x02,0xed,0xeb,0x00,0x00,0x00,0x0f,0x02,0x00,0x00,0x26,0x02,0x00, +0x00,0x06,0x02,0x80,0x40,0x01,0x02,0x00,0x00,0xa0,0x01,0x81,0x00,0x01,0x02,0x00, +0x40,0x15,0x02,0x80,0x40,0x01,0x03,0x00,0xc0,0x01,0x02,0x00,0x41,0x20,0x02,0x40, +0x02,0x19,0x02,0x00,0x80,0x15,0x02,0x80,0x40,0x01,0x02,0x00,0x80,0xa0,0x02,0x00, +0x00,0x05,0x02,0x00,0x00,0x29,0xa6,0xa5,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x03,0x00,0x02,0x5b,0x5d,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x04,0x70,0x75, +0x73,0x68,0x3a,0x3a,0x00,0x00,0x00,0x38,0x53,0x43,0x00,0x03,0x00,0x05,0x00,0x02, +0x48,0x39,0x00,0x00,0x00,0x05,0x02,0x00,0x00,0x26,0x01,0x80,0x00,0x06,0x02,0x00, +0x40,0x01,0x01,0x80,0x00,0xa0,0x01,0x80,0x00,0x29,0xfa,0x4e,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x06,0x64,0x65,0x6c,0x65,0x74,0x65,0x90,0x7d, +0x00,0x00,0x00,0x3e,0x53,0x43,0x00,0x03,0x00,0x05,0x00,0x02,0x48,0x39,0x00,0x00, +0x00,0x06,0x00,0x00,0x00,0xa6,0x01,0x00,0xc0,0x3f,0x01,0x80,0x00,0x06,0x02,0x00, +0x03,0x40,0x01,0x80,0x00,0x21,0x01,0x00,0x00,0x29,0xb1,0xf4,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x08,0x65,0x61,0x63,0x68,0x5f,0x6b,0x65,0x79, +0x81,0xeb,0x00,0x00,0x00,0x73,0x53,0x43,0x00,0x04,0x00,0x08,0x00,0x02,0x1c,0x04, +0x00,0x00,0x00,0x12,0x02,0x00,0x00,0x26,0x02,0x00,0x00,0x06,0x02,0x80,0x40,0x01, +0x02,0x00,0x00,0xa0,0x01,0x81,0x00,0x01,0x02,0x00,0x40,0x15,0x02,0x80,0x40,0x01, +0x03,0x00,0xc0,0x01,0x02,0x00,0x41,0x20,0x02,0x40,0x01,0x19,0x02,0x00,0x00,0x05, +0x00,0x40,0x02,0x97,0x02,0x00,0xc0,0x01,0x02,0x80,0x80,0x15,0x03,0x00,0x40,0x01, +0x03,0x81,0x00,0x01,0x02,0x80,0x81,0x20,0x02,0x00,0x00,0x29,0x66,0x50,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x02,0x5b,0x5d,0x00,0x04,0x63,0x61, +0x6c,0x6c,0x00,0x03,0x5b,0x5d,0x3d,0x37,0xc8,0x00,0x00,0x00,0x7a,0x53,0x43,0x00, +0x03,0x00,0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0xa6,0x01, +0x00,0xc0,0x37,0x01,0x80,0x00,0x06,0x02,0x00,0x03,0x40,0x01,0x80,0x00,0x21,0x01, +0x80,0x80,0x01,0x01,0x80,0x40,0x20,0x02,0x3f,0xff,0x83,0x01,0x80,0x80,0xb2,0x01, +0xc0,0x01,0x19,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x29,0x02,0x00,0x80,0x01,0x02, +0x80,0x05,0x40,0x02,0x00,0xc0,0x21,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x29,0x7f, +0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x08,0x65,0x61,0x63, +0x68,0x5f,0x6b,0x65,0x79,0x00,0x04,0x73,0x69,0x7a,0x65,0x00,0x02,0x3d,0x3d,0x00, +0x04,0x65,0x61,0x63,0x68,0x0b,0x74,0x00,0x00,0x00,0x6c,0x53,0x43,0x00,0x04,0x00, +0x07,0x00,0x02,0xed,0xeb,0x00,0x00,0x00,0x10,0x02,0x00,0x00,0x26,0x02,0x00,0x00, +0x06,0x02,0x80,0x40,0x01,0x02,0x00,0x00,0xa0,0x01,0x81,0x00,0x01,0x02,0x00,0x40, +0x15,0x02,0x80,0x40,0x01,0x03,0x00,0xc0,0x01,0x02,0x00,0x41,0x20,0x02,0x40,0x01, +0x19,0x02,0x00,0x00,0x05,0x00,0x40,0x01,0x97,0x02,0x00,0x80,0x15,0x02,0x80,0x40, +0x01,0x02,0x00,0x80,0xa0,0x02,0x00,0x00,0x29,0xaa,0x9a,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x03,0x00,0x02,0x5b,0x5d,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00, +0x04,0x70,0x75,0x73,0x68,0x3a,0x3a,0x00,0x00,0x00,0x38,0x53,0x43,0x00,0x03,0x00, +0x05,0x00,0x02,0x48,0x39,0x00,0x00,0x00,0x05,0x02,0x00,0x00,0x26,0x01,0x80,0x00, +0x06,0x02,0x00,0x40,0x01,0x01,0x80,0x00,0xa0,0x01,0x80,0x00,0x29,0xfa,0x4e,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x06,0x64,0x65,0x6c,0x65,0x74, +0x65,0x90,0x7d,0x00,0x00,0x00,0x3e,0x53,0x43,0x00,0x03,0x00,0x05,0x00,0x02,0x48, +0x39,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0xa6,0x01,0x00,0xc0,0x3f,0x01,0x80,0x00, +0x06,0x02,0x00,0x03,0x40,0x01,0x80,0x00,0x21,0x01,0x00,0x00,0x29,0xb1,0xf4,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x08,0x65,0x61,0x63,0x68,0x5f, +0x6b,0x65,0x79,0x81,0xeb,0x00,0x00,0x00,0x6f,0x53,0x43,0x00,0x04,0x00,0x08,0x00, +0x02,0x1c,0x04,0x00,0x00,0x00,0x11,0x02,0x00,0x00,0x26,0x02,0x00,0x00,0x06,0x02, +0x80,0x40,0x01,0x02,0x00,0x00,0xa0,0x01,0x81,0x00,0x01,0x02,0x00,0x40,0x15,0x02, +0x80,0x40,0x01,0x03,0x00,0xc0,0x01,0x02,0x00,0x41,0x20,0x02,0x40,0x03,0x19,0x02, +0x00,0xc0,0x01,0x02,0x80,0x80,0x15,0x03,0x00,0x40,0x01,0x03,0x81,0x00,0x01,0x02, +0x80,0x81,0x20,0x02,0x00,0x00,0x05,0x02,0x00,0x00,0x29,0xc6,0x2d,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x02,0x5b,0x5d,0x00,0x04,0x63,0x61,0x6c, +0x6c,0x00,0x03,0x5b,0x5d,0x3d,0x37,0xc8,0x00,0x00,0x00,0x24,0x53,0x43,0x00,0x01, +0x00,0x02,0x00,0x02,0x56,0xbe,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x05,0x00,0x00, +0x00,0x29,0x8b,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x41,0x53,0x43,0x00,0x01,0x00,0x03,0x00,0x02,0x46,0x9f,0x00,0x00, +0x00,0x04,0x00,0x80,0x00,0x06,0x01,0x00,0x00,0x91,0x00,0x80,0x00,0xa0,0x01,0x00, +0x00,0x29,0x38,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x07, +0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x00,0x0a,0x45,0x6e,0x75,0x6d,0x65,0x72,0x61, +0x62,0x6c,0x65,0xfa,0xae,0x00,0x00,0x00,0x68,0x53,0x43,0x00,0x01,0x00,0x02,0x00, +0x02,0x56,0xbe,0x00,0x00,0x00,0x10,0x00,0x80,0x00,0x06,0x00,0x80,0x40,0x47,0x01, +0x00,0x02,0xc0,0x00,0x80,0x00,0x46,0x00,0x80,0x00,0x06,0x00,0x80,0x40,0x47,0x01, +0x00,0x04,0xc0,0x00,0x80,0x40,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x06,0xc0,0x00, +0x80,0x40,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x08,0xc0,0x00,0x80,0x00,0x46,0x00, +0x00,0x00,0x05,0x00,0x00,0x00,0x29,0xb4,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x02,0x00,0x04,0x6c,0x6f,0x6f,0x70,0x00,0x04,0x65,0x76,0x61,0x6c,0x49, +0x1f,0x00,0x00,0x00,0x42,0x53,0x43,0x00,0x02,0x00,0x03,0x00,0x02,0x1f,0xcf,0x00, +0x00,0x00,0x08,0x00,0x00,0x00,0x26,0x00,0x40,0x01,0x17,0x01,0x00,0x00,0x2b,0x01, +0x00,0x00,0x20,0x01,0x00,0x00,0x07,0x01,0x3f,0xfe,0x18,0x00,0x00,0x00,0x05,0x00, +0x00,0x00,0x29,0xce,0x4a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, +0x04,0x63,0x61,0x6c,0x6c,0x38,0x03,0x00,0x00,0x00,0x70,0x53,0x43,0x00,0x03,0x00, +0x06,0x00,0x02,0x78,0x5a,0x00,0x00,0x00,0x07,0x02,0x00,0x00,0x26,0x01,0x80,0x00, +0x06,0x02,0x00,0x00,0x91,0x02,0x80,0x00,0x3d,0x02,0x00,0x80,0xa0,0x01,0x80,0x00, +0xa0,0x01,0x80,0x00,0x29,0xfe,0xe8,0x00,0x00,0x00,0x01,0x11,0x00,0x14,0x65,0x76, +0x61,0x6c,0x20,0x6e,0x6f,0x74,0x20,0x69,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74, +0x65,0x64,0x64,0xfa,0x00,0x00,0x00,0x03,0x00,0x05,0x72,0x61,0x69,0x73,0x65,0x00, +0x13,0x4e,0x6f,0x74,0x49,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x65,0x64,0x45, +0x72,0x72,0x6f,0x72,0x00,0x03,0x6e,0x65,0x77,0x64,0x27,0x00,0x00,0x00,0x3e,0x53, +0x43,0x00,0x03,0x00,0x05,0x00,0x02,0x48,0x39,0x00,0x00,0x00,0x05,0x02,0x00,0x00, +0x26,0x01,0x80,0x00,0x11,0x02,0x00,0x40,0x01,0x01,0x80,0x40,0xa0,0x01,0x80,0x00, +0x29,0xe8,0x52,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x06,0x4b, +0x65,0x72,0x6e,0x65,0x6c,0x00,0x04,0x65,0x76,0x61,0x6c,0x1a,0xb1,0x00,0x00,0x00, +0x42,0x53,0x43,0x00,0x02,0x00,0x03,0x00,0x02,0x1f,0xcf,0x00,0x00,0x00,0x08,0x00, +0x00,0x00,0x26,0x00,0x40,0x01,0x17,0x01,0x00,0x00,0x2b,0x01,0x00,0x00,0x20,0x01, +0x00,0x00,0x07,0x01,0x3f,0xfe,0x18,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x29,0xce, +0x4a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x63,0x61,0x6c, +0x6c,0x38,0x03,0x00,0x00,0x00,0xb8,0x53,0x43,0x00,0x01,0x00,0x04,0x00,0x02,0x36, +0x78,0x00,0x00,0x00,0x16,0x00,0x80,0x00,0x48,0x01,0x00,0x02,0xc0,0x00,0x80,0x00, +0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x04,0xc0,0x00,0x80,0x40,0x46,0x00,0x80,0x00, +0x48,0x01,0x00,0x06,0xc0,0x00,0x80,0x80,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x01, +0x84,0x01,0x80,0x01,0x04,0x02,0x00,0x00,0x05,0x00,0x81,0x01,0x20,0x00,0x80,0x00, +0x48,0x01,0x00,0x0a,0xc0,0x00,0x81,0x40,0x46,0x00,0x80,0x00,0x48,0x01,0x00,0x0c, +0xc0,0x00,0x81,0x80,0x46,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x29,0x8c,0xae,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x04,0x65,0x61,0x63,0x68,0x00, +0x0a,0x65,0x61,0x63,0x68,0x5f,0x69,0x6e,0x64,0x65,0x78,0x00,0x08,0x63,0x6f,0x6c, +0x6c,0x65,0x63,0x74,0x21,0x00,0x04,0x6d,0x61,0x70,0x21,0x00,0x0c,0x61,0x6c,0x69, +0x61,0x73,0x5f,0x6d,0x65,0x74,0x68,0x6f,0x64,0x00,0x0a,0x69,0x6e,0x69,0x74,0x69, +0x61,0x6c,0x69,0x7a,0x65,0x00,0x06,0x64,0x65,0x6c,0x65,0x74,0x65,0x38,0x72,0x00, +0x00,0x00,0x8b,0x53,0x43,0x00,0x04,0x00,0x08,0x00,0x02,0x1c,0x04,0x00,0x00,0x00, +0x15,0x00,0x00,0x00,0xa6,0x02,0x3f,0xff,0x03,0x02,0x80,0x00,0x06,0x02,0x80,0x00, +0x20,0x02,0x80,0x40,0xaf,0x01,0x01,0x00,0x01,0x01,0x81,0x40,0x01,0x00,0x40,0x03, +0x97,0x02,0x00,0x40,0x01,0x02,0x80,0x00,0x06,0x03,0x00,0x80,0x01,0x03,0x01,0x00, +0xad,0x01,0x01,0x80,0x01,0x02,0x80,0xc0,0xa0,0x02,0x00,0x80,0xa0,0x02,0x00,0x80, +0x01,0x02,0x80,0xc0,0x01,0x02,0x01,0x40,0xb3,0x02,0x3f,0xfa,0x98,0x00,0x00,0x00, +0x06,0x00,0x00,0x00,0x29,0xd4,0x5c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x06,0x00,0x06,0x6c,0x65,0x6e,0x67,0x74,0x68,0x00,0x01,0x2d,0x00,0x04,0x63,0x61, +0x6c,0x6c,0x00,0x02,0x5b,0x5d,0x00,0x01,0x2b,0x00,0x01,0x3c,0xab,0x21,0x00,0x00, +0x00,0x70,0x53,0x43,0x00,0x03,0x00,0x05,0x00,0x02,0x48,0x39,0x00,0x00,0x00,0x10, +0x00,0x00,0x00,0xa6,0x01,0x3f,0xff,0x83,0x00,0x40,0x03,0x17,0x01,0x80,0x40,0x01, +0x02,0x00,0x80,0x01,0x01,0x80,0x00,0xa0,0x01,0x80,0x80,0x01,0x01,0x80,0x40,0xad, +0x01,0x00,0xc0,0x01,0x01,0x80,0x80,0x01,0x02,0x00,0x00,0x06,0x02,0x00,0xc0,0x20, +0x01,0x80,0x80,0xb3,0x01,0xbf,0xfa,0x98,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x29, +0x8e,0x95,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x04,0x63,0x61, +0x6c,0x6c,0x00,0x01,0x2b,0x00,0x01,0x3c,0x00,0x06,0x6c,0x65,0x6e,0x67,0x74,0x68, +0x54,0xf1,0x00,0x00,0x00,0x40,0x53,0x43,0x00,0x02,0x00,0x04,0x00,0x02,0x6f,0x28, +0x00,0x00,0x00,0x06,0x00,0x00,0x00,0xa6,0x01,0x00,0x00,0x06,0x01,0x80,0x03,0x40, +0x01,0x00,0x00,0x21,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x29,0xfa,0xe2,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x0a,0x65,0x61,0x63,0x68,0x5f,0x69, +0x6e,0x64,0x65,0x78,0xb6,0xf5,0x00,0x00,0x00,0x57,0x53,0x43,0x00,0x03,0x00,0x07, +0x00,0x02,0x68,0x7b,0x00,0x00,0x00,0x0b,0x02,0x00,0x00,0x26,0x01,0x80,0x40,0x15, +0x02,0x00,0x00,0x06,0x02,0x80,0x40,0x01,0x02,0x00,0x40,0xa0,0x01,0x80,0x00,0xa0, +0x02,0x00,0x00,0x06,0x02,0x80,0x40,0x01,0x03,0x00,0xc0,0x01,0x02,0x00,0x81,0x20, +0x01,0x80,0x00,0x29,0x75,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03, +0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x02,0x5b,0x5d,0x00,0x03,0x5b,0x5d,0x3d,0x3e, +0x8a,0x00,0x00,0x01,0x8c,0x53,0x43,0x00,0x05,0x00,0x09,0x00,0x02,0x3b,0x15,0x00, +0x00,0x00,0x39,0x00,0x20,0x00,0xa6,0x00,0x40,0x01,0x17,0x00,0x40,0x01,0x17,0x00, +0x40,0x01,0x17,0x00,0xbf,0xff,0x83,0x01,0x00,0x00,0x05,0x02,0x80,0x40,0x01,0x03, +0x00,0x00,0x91,0x02,0x80,0x00,0xa0,0x02,0xc0,0x00,0x99,0x00,0x40,0x02,0x17,0x02, +0x80,0x00,0x06,0x03,0x00,0x01,0x91,0x03,0x80,0x00,0x3d,0x02,0x80,0x81,0x20,0x02, +0x80,0x40,0x01,0x03,0x3f,0xff,0x83,0x02,0x81,0x00,0xb3,0x02,0xc0,0x02,0x19,0x02, +0x80,0x00,0x06,0x03,0x00,0x02,0x91,0x03,0x80,0x00,0xbd,0x02,0x80,0x81,0x20,0x02, +0x80,0x00,0x06,0x02,0x81,0x80,0x20,0x02,0x80,0x40,0x01,0x03,0x3f,0xff,0x83,0x02, +0x81,0xc0,0xb5,0x02,0xc0,0x0d,0x19,0x02,0x80,0x00,0x05,0x03,0x00,0x00,0x06,0x03, +0x80,0x40,0x01,0x03,0x82,0x40,0xaf,0x04,0x01,0x40,0x01,0x03,0x02,0x01,0x20,0x02, +0x3f,0xff,0x83,0x00,0x40,0x07,0x17,0x02,0x80,0xc0,0x01,0x02,0xc0,0x02,0x19,0x02, +0x80,0xc0,0x01,0x03,0x01,0x00,0x01,0x02,0x82,0x80,0xa0,0x00,0x40,0x00,0x97,0x02, +0x80,0x80,0x01,0x03,0x00,0x00,0x06,0x03,0x81,0x00,0x01,0x04,0x01,0x40,0x01,0x03, +0x02,0x01,0x20,0x02,0x81,0x00,0x01,0x02,0x82,0xc0,0xad,0x02,0x01,0x40,0x01,0x02, +0x81,0x00,0x01,0x03,0x00,0x40,0x01,0x02,0x81,0x00,0xb3,0x02,0xbf,0xf7,0x18,0x00, +0x00,0x00,0x06,0x00,0x00,0x00,0x29,0x02,0x04,0x00,0x00,0x00,0x02,0x11,0x00,0x21, +0x65,0x78,0x70,0x65,0x63,0x74,0x65,0x64,0x20,0x49,0x6e,0x74,0x65,0x67,0x65,0x72, +0x20,0x66,0x6f,0x72,0x20,0x31,0x73,0x74,0x20,0x61,0x72,0x67,0x75,0x6d,0x65,0x6e, +0x74,0x11,0x00,0x13,0x6e,0x65,0x67,0x61,0x74,0x69,0x76,0x65,0x20,0x61,0x72,0x72, +0x61,0x79,0x20,0x73,0x69,0x7a,0x65,0x36,0xf1,0x00,0x00,0x00,0x0c,0x00,0x08,0x6b, +0x69,0x6e,0x64,0x5f,0x6f,0x66,0x3f,0x00,0x07,0x49,0x6e,0x74,0x65,0x67,0x65,0x72, +0x00,0x05,0x72,0x61,0x69,0x73,0x65,0x00,0x09,0x54,0x79,0x70,0x65,0x45,0x72,0x72, +0x6f,0x72,0x00,0x01,0x3c,0x00,0x0d,0x41,0x72,0x67,0x75,0x6d,0x65,0x6e,0x74,0x45, +0x72,0x72,0x6f,0x72,0x00,0x05,0x63,0x6c,0x65,0x61,0x72,0x00,0x01,0x3e,0x00,0x03, +0x5b,0x5d,0x3d,0x00,0x01,0x2d,0x00,0x04,0x63,0x61,0x6c,0x6c,0x00,0x01,0x2b,0x53, +0xdf,0x00,0x00,0x00,0x90,0x53,0x43,0x00,0x05,0x00,0x07,0x00,0x02,0xda,0xdb,0x00, +0x00,0x00,0x16,0x02,0x00,0x00,0xa6,0x00,0x40,0x02,0x17,0x02,0x80,0x00,0x06,0x03, +0x00,0xc0,0x01,0x02,0x80,0x00,0xa0,0x02,0x00,0x40,0x01,0x02,0x80,0x00,0x06,0x03, +0x00,0x40,0x01,0x02,0x80,0x40,0xa0,0x01,0x81,0x40,0x01,0x02,0xbf,0xfb,0x98,0x02, +0x81,0x00,0x01,0x03,0x00,0x00,0x05,0x02,0x80,0x80,0xb2,0x02,0xc0,0x00,0x99,0x02, +0x80,0x80,0x01,0x02,0xc0,0x01,0x99,0x02,0x80,0x80,0x01,0x02,0x80,0xc0,0x20,0x00, +0x40,0x00,0x97,0x02,0x81,0x00,0x01,0x02,0x80,0x00,0x29,0x67,0xba,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x09,0x64,0x65,0x6c,0x65,0x74,0x65,0x5f, +0x61,0x74,0x00,0x05,0x69,0x6e,0x64,0x65,0x78,0x00,0x02,0x3d,0x3d,0x00,0x04,0x63, +0x61,0x6c,0x6c,0x30,0x9c,0x00,0x00,0x00,0x24,0x53,0x43,0x00,0x01,0x00,0x02,0x00, +0x02,0x56,0xbe,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x29,0x8b, +0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x24,0x53,0x43,0x00,0x01,0x00,0x02,0x00,0x02,0x56,0xbe,0x00,0x00,0x00,0x02,0x00, +0x00,0x00,0x05,0x00,0x00,0x00,0x29,0x8b,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x53,0x43,0x00,0x01,0x00,0x03,0x00, +0x02,0x46,0x9f,0x00,0x00,0x00,0x0b,0x00,0x80,0x00,0x06,0x01,0x00,0x00,0x91,0x00, +0x80,0x00,0xa0,0x00,0x80,0x00,0x06,0x01,0x00,0x01,0x11,0x00,0x80,0x00,0xa0,0x00, +0x80,0x00,0x48,0x01,0x00,0x02,0xc0,0x00,0x80,0xc0,0x46,0x00,0x00,0x00,0x05,0x00, +0x00,0x00,0x29,0x51,0x39,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00, +0x07,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x00,0x0a,0x45,0x6e,0x75,0x6d,0x65,0x72, +0x61,0x62,0x6c,0x65,0x00,0x0a,0x43,0x6f,0x6d,0x70,0x61,0x72,0x61,0x62,0x6c,0x65, +0x00,0x05,0x73,0x6f,0x72,0x74,0x21,0xd1,0xed,0x00,0x00,0x00,0x47,0x53,0x43,0x00, +0x02,0x00,0x05,0x00,0x02,0x7f,0x09,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0xa6,0x01, +0x00,0x00,0x06,0x01,0x80,0x00,0x06,0x02,0x00,0x40,0x01,0x01,0x80,0x40,0x21,0x01, +0x00,0x00,0xa0,0x01,0x00,0x00,0x29,0x40,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x02,0x00,0x07,0x72,0x65,0x70,0x6c,0x61,0x63,0x65,0x00,0x04,0x73,0x6f, +0x72,0x74,0x95,0xe4,0x00,0x00,0x00,0x00, +}; Added: vendor/mruby-b5830ae/src/mruby_core.rake (+25 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/mruby_core.rake 2013-01-09 13:19:18 +0900 (bc84ed6) @@ -0,0 +1,25 @@ +dir = File.dirname(__FILE__).sub(%r|^\./|, '') + +MRuby.each_target do + lex_def = "#{dir}/lex.def" + objs = Dir.glob("src/*.{c}").map { |f| f.pathmap("#{build_dir}/%X.o") } + ["#{build_dir}/#{dir}/y.tab.o"] + self.libmruby << objs + + file "#{build_dir}/lib/libmruby_core.a" => objs do |t| + archive t.name, 'r', t.prerequisites + end + + # Parser + file "#{build_dir}/#{dir}/y.tab.c" => ["#{dir}/parse.y"] do |t| + run_yacc t.name, t.prerequisites.first + end + + file "#{build_dir}/#{dir}/y.tab.o" => ["#{build_dir}/#{dir}/y.tab.c", lex_def] do |t| + compile_c t.name, t.prerequisites.first, [], dir + end + + # Lexical analyzer + file lex_def => "#{dir}/keywords" do |t| + run_gperf t.name, t.prerequisites.first + end +end Added: vendor/mruby-b5830ae/src/name2ctype.h (+17981 -0) 100644 =================================================================== --- /dev/null +++ vendor/mruby-b5830ae/src/name2ctype.h 2013-01-09 13:19:18 +0900 (0773bbf) @@ -0,0 +1,17981 @@ +/* C code produced by gperf version 3.0.3 */ +/* Command-line: gperf -7 -c -j1 -i1 -t -C -P -T -H uniname2ctype_hash -Q uniname2ctype_pool -N uniname2ctype_p */ +#ifndef USE_UNICODE_PROPERTIES +/* Computed positions: -k'1,3' */ +#else /* USE_UNICODE_PROPERTIES */ +/* Computed positions: -k'1-3,6,12,16,$' */ +#endif /* USE_UNICODE_PROPERTIES */ + +#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 + + + +#ifdef USE_UNICODE_PROPERTIES +#ifdef USE_UNICODE_PROPERTIES +/* 'Any': - */ +static const OnigCodePoint CR_Any[] = { + 1, + 0x0000, 0x10ffff, +}; /* CR_Any */ + +/* 'Assigned': - */ +static const OnigCodePoint CR_Assigned[] = { + 485, + 0x0000, 0x0377, + 0x037a, 0x037e, + 0x0384, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x03a1, + 0x03a3, 0x0525, + 0x0531, 0x0556, + 0x0559, 0x055f, + 0x0561, 0x0587, + 0x0589, 0x058a, + 0x0591, 0x05c7, + 0x05d0, 0x05ea, + 0x05f0, 0x05f4, + 0x0600, 0x0603, + 0x0606, 0x061b, + 0x061e, 0x061f, + 0x0621, 0x065e, + 0x0660, 0x070d, + 0x070f, 0x074a, + 0x074d, 0x07b1, + 0x07c0, 0x07fa, + 0x0800, 0x082d, + 0x0830, 0x083e, + 0x0900, 0x0939, + 0x093c, 0x094e, + 0x0950, 0x0955, + 0x0958, 0x0972, + 0x0979, 0x097f, + 0x0981, 0x0983, + 0x0985, 0x098c, + 0x098f, 0x0990, + 0x0993, 0x09a8, + 0x09aa, 0x09b0, + 0x09b2, 0x09b2, + 0x09b6, 0x09b9, + 0x09bc, 0x09c4, + 0x09c7, 0x09c8, + 0x09cb, 0x09ce, + 0x09d7, 0x09d7, + 0x09dc, 0x09dd, + 0x09df, 0x09e3, + 0x09e6, 0x09fb, + 0x0a01, 0x0a03, + 0x0a05, 0x0a0a, + 0x0a0f, 0x0a10, + 0x0a13, 0x0a28, + 0x0a2a, 0x0a30, + 0x0a32, 0x0a33, + 0x0a35, 0x0a36, + 0x0a38, 0x0a39, + 0x0a3c, 0x0a3c, + 0x0a3e, 0x0a42, + 0x0a47, 0x0a48, + 0x0a4b, 0x0a4d, + 0x0a51, 0x0a51, + 0x0a59, 0x0a5c, + 0x0a5e, 0x0a5e, + 0x0a66, 0x0a75, + 0x0a81, 0x0a83, + 0x0a85, 0x0a8d, + 0x0a8f, 0x0a91, + 0x0a93, 0x0aa8, + 0x0aaa, 0x0ab0, + 0x0ab2, 0x0ab3, + 0x0ab5, 0x0ab9, + 0x0abc, 0x0ac5, + 0x0ac7, 0x0ac9, + 0x0acb, 0x0acd, + 0x0ad0, 0x0ad0, + 0x0ae0, 0x0ae3, + 0x0ae6, 0x0aef, + 0x0af1, 0x0af1, + 0x0b01, 0x0b03, + 0x0b05, 0x0b0c, + 0x0b0f, 0x0b10, + 0x0b13, 0x0b28, + 0x0b2a, 0x0b30, + 0x0b32, 0x0b33, + 0x0b35, 0x0b39, + 0x0b3c, 0x0b44, + 0x0b47, 0x0b48, + 0x0b4b, 0x0b4d, + 0x0b56, 0x0b57, + 0x0b5c, 0x0b5d, + 0x0b5f, 0x0b63, + 0x0b66, 0x0b71, + 0x0b82, 0x0b83, + 0x0b85, 0x0b8a, + 0x0b8e, 0x0b90, + 0x0b92, 0x0b95, + 0x0b99, 0x0b9a, + 0x0b9c, 0x0b9c, + 0x0b9e, 0x0b9f, + 0x0ba3, 0x0ba4, + 0x0ba8, 0x0baa, + 0x0bae, 0x0bb9, + 0x0bbe, 0x0bc2, + 0x0bc6, 0x0bc8, + 0x0bca, 0x0bcd, + 0x0bd0, 0x0bd0, + 0x0bd7, 0x0bd7, + 0x0be6, 0x0bfa, + 0x0c01, 0x0c03, + 0x0c05, 0x0c0c, + 0x0c0e, 0x0c10, + 0x0c12, 0x0c28, + 0x0c2a, 0x0c33, + 0x0c35, 0x0c39, + 0x0c3d, 0x0c44, + 0x0c46, 0x0c48, + 0x0c4a, 0x0c4d, + 0x0c55, 0x0c56, + 0x0c58, 0x0c59, + 0x0c60, 0x0c63, + 0x0c66, 0x0c6f, + 0x0c78, 0x0c7f, + 0x0c82, 0x0c83, + 0x0c85, 0x0c8c, + 0x0c8e, 0x0c90, + 0x0c92, 0x0ca8, + 0x0caa, 0x0cb3, + 0x0cb5, 0x0cb9, + 0x0cbc, 0x0cc4, + 0x0cc6, 0x0cc8, + 0x0cca, 0x0ccd, + 0x0cd5, 0x0cd6, + 0x0cde, 0x0cde, + 0x0ce0, 0x0ce3, + 0x0ce6, 0x0cef, + 0x0cf1, 0x0cf2, + 0x0d02, 0x0d03, + 0x0d05, 0x0d0c, + 0x0d0e, 0x0d10, + 0x0d12, 0x0d28, + 0x0d2a, 0x0d39, + 0x0d3d, 0x0d44, + 0x0d46, 0x0d48, + 0x0d4a, 0x0d4d, + 0x0d57, 0x0d57, + 0x0d60, 0x0d63, + 0x0d66, 0x0d75, + 0x0d79, 0x0d7f, + 0x0d82, 0x0d83, + 0x0d85, 0x0d96, + 0x0d9a, 0x0db1, + 0x0db3, 0x0dbb, + 0x0dbd, 0x0dbd, + 0x0dc0, 0x0dc6, + 0x0dca, 0x0dca, + 0x0dcf, 0x0dd4, + 0x0dd6, 0x0dd6, + 0x0dd8, 0x0ddf, + 0x0df2, 0x0df4, + 0x0e01, 0x0e3a, + 0x0e3f, 0x0e5b, + 0x0e81, 0x0e82, + 0x0e84, 0x0e84, + 0x0e87, 0x0e88, + 0x0e8a, 0x0e8a, + 0x0e8d, 0x0e8d, + 0x0e94, 0x0e97, + 0x0e99, 0x0e9f, + 0x0ea1, 0x0ea3, + 0x0ea5, 0x0ea5, + 0x0ea7, 0x0ea7, + 0x0eaa, 0x0eab, + 0x0ead, 0x0eb9, + 0x0ebb, 0x0ebd, + 0x0ec0, 0x0ec4, + 0x0ec6, 0x0ec6, + 0x0ec8, 0x0ecd, + 0x0ed0, 0x0ed9, + 0x0edc, 0x0edd, + 0x0f00, 0x0f47, + 0x0f49, 0x0f6c, + 0x0f71, 0x0f8b, + 0x0f90, 0x0f97, + 0x0f99, 0x0fbc, + 0x0fbe, 0x0fcc, + 0x0fce, 0x0fd8, + 0x1000, 0x10c5, + 0x10d0, 0x10fc, + 0x1100, 0x1248, + 0x124a, 0x124d, + 0x1250, 0x1256, + 0x1258, 0x1258, + 0x125a, 0x125d, + 0x1260, 0x1288, + 0x128a, 0x128d, + 0x1290, 0x12b0, + 0x12b2, 0x12b5, + 0x12b8, 0x12be, + 0x12c0, 0x12c0, + 0x12c2, 0x12c5, + 0x12c8, 0x12d6, + 0x12d8, 0x1310, + 0x1312, 0x1315, + 0x1318, 0x135a, + 0x135f, 0x137c, + 0x1380, 0x1399, + 0x13a0, 0x13f4, + 0x1400, 0x169c, + 0x16a0, 0x16f0, + 0x1700, 0x170c, + 0x170e, 0x1714, + 0x1720, 0x1736, + 0x1740, 0x1753, + 0x1760, 0x176c, + 0x176e, 0x1770, + 0x1772, 0x1773, + 0x1780, 0x17dd, + 0x17e0, 0x17e9, + 0x17f0, 0x17f9, + 0x1800, 0x180e, + 0x1810, 0x1819, + 0x1820, 0x1877, + 0x1880, 0x18aa, + 0x18b0, 0x18f5, + 0x1900, 0x191c, + 0x1920, 0x192b, + 0x1930, 0x193b, + 0x1940, 0x1940, + 0x1944, 0x196d, + 0x1970, 0x1974, + 0x1980, 0x19ab, + 0x19b0, 0x19c9, + 0x19d0, 0x19da, + 0x19de, 0x1a1b, + 0x1a1e, 0x1a5e, + 0x1a60, 0x1a7c, + 0x1a7f, 0x1a89, + 0x1a90, 0x1a99, + 0x1aa0, 0x1aad, + 0x1b00, 0x1b4b, + 0x1b50, 0x1b7c, + 0x1b80, 0x1baa, + 0x1bae, 0x1bb9, + 0x1c00, 0x1c37, + 0x1c3b, 0x1c49, + 0x1c4d, 0x1c7f, + 0x1cd0, 0x1cf2, + 0x1d00, 0x1de6, + 0x1dfd, 0x1f15, + 0x1f18, 0x1f1d, + 0x1f20, 0x1f45, + 0x1f48, 0x1f4d, + 0x1f50, 0x1f57, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f7d, + 0x1f80, 0x1fb4, + 0x1fb6, 0x1fc4, + 0x1fc6, 0x1fd3, + 0x1fd6, 0x1fdb, + 0x1fdd, 0x1fef, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ffe, + 0x2000, 0x2064, + 0x206a, 0x2071, + 0x2074, 0x208e, + 0x2090, 0x2094, + 0x20a0, 0x20b8, + 0x20d0, 0x20f0, + 0x2100, 0x2189, + 0x2190, 0x23e8, + 0x2400, 0x2426, + 0x2440, 0x244a, + 0x2460, 0x26cd, + 0x26cf, 0x26e1, + 0x26e3, 0x26e3, + 0x26e8, 0x26ff, + 0x2701, 0x2704, + 0x2706, 0x2709, + 0x270c, 0x2727, + 0x2729, 0x274b, + 0x274d, 0x274d, + 0x274f, 0x2752, + 0x2756, 0x275e, + 0x2761, 0x2794, + 0x2798, 0x27af, + 0x27b1, 0x27be, + 0x27c0, 0x27ca, + 0x27cc, 0x27cc, + 0x27d0, 0x2b4c, + 0x2b50, 0x2b59, + 0x2c00, 0x2c2e, + 0x2c30, 0x2c5e, + 0x2c60, 0x2cf1, + 0x2cf9, 0x2d25, + 0x2d30, 0x2d65, + 0x2d6f, 0x2d6f, + 0x2d80, 0x2d96, + 0x2da0, 0x2da6, + 0x2da8, 0x2dae, + 0x2db0, 0x2db6, + 0x2db8, 0x2dbe, + 0x2dc0, 0x2dc6, + 0x2dc8, 0x2dce, + 0x2dd0, 0x2dd6, + 0x2dd8, 0x2dde, + 0x2de0, 0x2e31, + 0x2e80, 0x2e99, + 0x2e9b, 0x2ef3, + 0x2f00, 0x2fd5, + 0x2ff0, 0x2ffb, + 0x3000, 0x303f, + 0x3041, 0x3096, + 0x3099, 0x30ff, + 0x3105, 0x312d, + 0x3131, 0x318e, + 0x3190, 0x31b7, + 0x31c0, 0x31e3, + 0x31f0, 0x321e, + 0x3220, 0x32fe, + 0x3300, 0x4db5, + 0x4dc0, 0x9fcb, + 0xa000, 0xa48c, + 0xa490, 0xa4c6, + 0xa4d0, 0xa62b, + 0xa640, 0xa65f, + 0xa662, 0xa673, + 0xa67c, 0xa697, + 0xa6a0, 0xa6f7, + 0xa700, 0xa78c, + 0xa7fb, 0xa82b, + 0xa830, 0xa839, + 0xa840, 0xa877, + 0xa880, 0xa8c4, + 0xa8ce, 0xa8d9, + 0xa8e0, 0xa8fb, + 0xa900, 0xa953, + 0xa95f, 0xa97c, + 0xa980, 0xa9cd, + 0xa9cf, 0xa9d9, + 0xa9de, 0xa9df, + 0xaa00, 0xaa36, + 0xaa40, 0xaa4d, + 0xaa50, 0xaa59, + 0xaa5c, 0xaa7b, + 0xaa80, 0xaac2, + 0xaadb, 0xaadf, + 0xabc0, 0xabed, + 0xabf0, 0xabf9, + 0xac00, 0xd7a3, + 0xd7b0, 0xd7c6, + 0xd7cb, 0xd7fb, + 0xd800, 0xfa2d, + 0xfa30, 0xfa6d, + 0xfa70, 0xfad9, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xfb1d, 0xfb36, + 0xfb38, 0xfb3c, + 0xfb3e, 0xfb3e, + 0xfb40, 0xfb41, + 0xfb43, 0xfb44, + 0xfb46, 0xfbb1, + 0xfbd3, 0xfd3f, + 0xfd50, 0xfd8f, + 0xfd92, 0xfdc7, + 0xfdf0, 0xfdfd, + 0xfe00, 0xfe19, + 0xfe20, 0xfe26, + 0xfe30, 0xfe52, + 0xfe54, 0xfe66, + 0xfe68, 0xfe6b, + 0xfe70, 0xfe74, + 0xfe76, 0xfefc, + 0xfeff, 0xfeff, + 0xff01, 0xffbe, + 0xffc2, 0xffc7, + 0xffca, 0xffcf, + 0xffd2, 0xffd7, + 0xffda, 0xffdc, + 0xffe0, 0xffe6, + 0xffe8, 0xffee, + 0xfff9, 0xfffd, + 0x10000, 0x1000b, + 0x1000d, 0x10026, + 0x10028, 0x1003a, + 0x1003c, 0x1003d, + 0x1003f, 0x1004d, + 0x10050, 0x1005d, + 0x10080, 0x100fa, + 0x10100, 0x10102, + 0x10107, 0x10133, + 0x10137, 0x1018a, + 0x10190, 0x1019b, + 0x101d0, 0x101fd, + 0x10280, 0x1029c, + 0x102a0, 0x102d0, + 0x10300, 0x1031e, + 0x10320, 0x10323, + 0x10330, 0x1034a, + 0x10380, 0x1039d, + 0x1039f, 0x103c3, + 0x103c8, 0x103d5, + 0x10400, 0x1049d, + 0x104a0, 0x104a9, + 0x10800, 0x10805, + 0x10808, 0x10808, + 0x1080a, 0x10835, + 0x10837, 0x10838, + 0x1083c, 0x1083c, + 0x1083f, 0x10855, + 0x10857, 0x1085f, + 0x10900, 0x1091b, + 0x1091f, 0x10939, + 0x1093f, 0x1093f, + 0x10a00, 0x10a03, + 0x10a05, 0x10a06, + 0x10a0c, 0x10a13, + 0x10a15, 0x10a17, + 0x10a19, 0x10a33, + 0x10a38, 0x10a3a, + 0x10a3f, 0x10a47, + 0x10a50, 0x10a58, + 0x10a60, 0x10a7f, + 0x10b00, 0x10b35, + 0x10b39, 0x10b55, + 0x10b58, 0x10b72, + 0x10b78, 0x10b7f, + 0x10c00, 0x10c48, + 0x10e60, 0x10e7e, + 0x11080, 0x110c1, + 0x12000, 0x1236e, + 0x12400, 0x12462, + 0x12470, 0x12473, + 0x13000, 0x1342e, + 0x1d000, 0x1d0f5, + 0x1d100, 0x1d126, + 0x1d129, 0x1d1dd, + 0x1d200, 0x1d245, + 0x1d300, 0x1d356, + 0x1d360, 0x1d371, + 0x1d400, 0x1d454, + 0x1d456, 0x1d49c, + 0x1d49e, 0x1d49f, + 0x1d4a2, 0x1d4a2, + 0x1d4a5, 0x1d4a6, + 0x1d4a9, 0x1d4ac, + 0x1d4ae, 0x1d4b9, + 0x1d4bb, 0x1d4bb, + 0x1d4bd, 0x1d4c3, + 0x1d4c5, 0x1d505, + 0x1d507, 0x1d50a, + 0x1d50d, 0x1d514, + 0x1d516, 0x1d51c, + 0x1d51e, 0x1d539, + 0x1d53b, 0x1d53e, + 0x1d540, 0x1d544, + 0x1d546, 0x1d546, + 0x1d54a, 0x1d550, + 0x1d552, 0x1d6a5, + 0x1d6a8, 0x1d7cb, + 0x1d7ce, 0x1d7ff, + 0x1f000, 0x1f02b, + 0x1f030, 0x1f093, + 0x1f100, 0x1f10a, + 0x1f110, 0x1f12e, + 0x1f131, 0x1f131, + 0x1f13d, 0x1f13d, + 0x1f13f, 0x1f13f, + 0x1f142, 0x1f142, + 0x1f146, 0x1f146, + 0x1f14a, 0x1f14e, + 0x1f157, 0x1f157, + 0x1f15f, 0x1f15f, + 0x1f179, 0x1f179, + 0x1f17b, 0x1f17c, + 0x1f17f, 0x1f17f, + 0x1f18a, 0x1f18d, + 0x1f190, 0x1f190, + 0x1f200, 0x1f200, + 0x1f210, 0x1f231, + 0x1f240, 0x1f248, + 0x20000, 0x2a6d6, + 0x2a700, 0x2b734, + 0x2f800, 0x2fa1d, + 0xe0001, 0xe0001, + 0xe0020, 0xe007f, + 0xe0100, 0xe01ef, + 0xf0000, 0xffffd, + 0x100000, 0x10fffd, +}; /* CR_Assigned */ + +/* 'C': Major Category */ +static const OnigCodePoint CR_C[] = { + 20, + 0x0000, 0x001f, + 0x007f, 0x009f, + 0x00ad, 0x00ad, + 0x0600, 0x0603, + 0x06dd, 0x06dd, + 0x070f, 0x070f, + 0x17b4, 0x17b5, + 0x200b, 0x200f, + 0x202a, 0x202e, + 0x2060, 0x2064, + 0x206a, 0x206f, + 0xd800, 0xf8ff, + 0xfeff, 0xfeff, + 0xfff9, 0xfffb, + 0x110bd, 0x110bd, + 0x1d173, 0x1d17a, + 0xe0001, 0xe0001, + 0xe0020, 0xe007f, + 0xf0000, 0xffffd, + 0x100000, 0x10ffff, +}; /* CR_C */ + +/* 'Cc': General Category */ +static const OnigCodePoint CR_Cc[] = { + 2, + 0x0000, 0x001f, + 0x007f, 0x009f, +}; /* CR_Cc */ + +/* 'Cf': General Category */ +static const OnigCodePoint CR_Cf[] = { + 15, + 0x00ad, 0x00ad, + 0x0600, 0x0603, + 0x06dd, 0x06dd, + 0x070f, 0x070f, + 0x17b4, 0x17b5, + 0x200b, 0x200f, + 0x202a, 0x202e, + 0x2060, 0x2064, + 0x206a, 0x206f, + 0xfeff, 0xfeff, + 0xfff9, 0xfffb, + 0x110bd, 0x110bd, + 0x1d173, 0x1d17a, + 0xe0001, 0xe0001, + 0xe0020, 0xe007f, +}; /* CR_Cf */ + +/* 'Cn': General Category */ +static const OnigCodePoint CR_Cn[] = { + 485, + 0x0378, 0x0379, + 0x037f, 0x0383, + 0x038b, 0x038b, + 0x038d, 0x038d, + 0x03a2, 0x03a2, + 0x0526, 0x0530, + 0x0557, 0x0558, + 0x0560, 0x0560, + 0x0588, 0x0588, + 0x058b, 0x0590, + 0x05c8, 0x05cf, + 0x05eb, 0x05ef, + 0x05f5, 0x05ff, + 0x0604, 0x0605, + 0x061c, 0x061d, + 0x0620, 0x0620, + 0x065f, 0x065f, + 0x070e, 0x070e, + 0x074b, 0x074c, + 0x07b2, 0x07bf, + 0x07fb, 0x07ff, + 0x082e, 0x082f, + 0x083f, 0x08ff, + 0x093a, 0x093b, + 0x094f, 0x094f, + 0x0956, 0x0957, + 0x0973, 0x0978, + 0x0980, 0x0980, + 0x0984, 0x0984, + 0x098d, 0x098e, + 0x0991, 0x0992, + 0x09a9, 0x09a9, + 0x09b1, 0x09b1, + 0x09b3, 0x09b5, + 0x09ba, 0x09bb, + 0x09c5, 0x09c6, + 0x09c9, 0x09ca, + 0x09cf, 0x09d6, + 0x09d8, 0x09db, + 0x09de, 0x09de, + 0x09e4, 0x09e5, + 0x09fc, 0x0a00, + 0x0a04, 0x0a04, + 0x0a0b, 0x0a0e, + 0x0a11, 0x0a12, + 0x0a29, 0x0a29, + 0x0a31, 0x0a31, + 0x0a34, 0x0a34, + 0x0a37, 0x0a37, + 0x0a3a, 0x0a3b, + 0x0a3d, 0x0a3d, + 0x0a43, 0x0a46, + 0x0a49, 0x0a4a, + 0x0a4e, 0x0a50, + 0x0a52, 0x0a58, + 0x0a5d, 0x0a5d, + 0x0a5f, 0x0a65, + 0x0a76, 0x0a80, + 0x0a84, 0x0a84, + 0x0a8e, 0x0a8e, + 0x0a92, 0x0a92, + 0x0aa9, 0x0aa9, + 0x0ab1, 0x0ab1, + 0x0ab4, 0x0ab4, + 0x0aba, 0x0abb, + 0x0ac6, 0x0ac6, + 0x0aca, 0x0aca, + 0x0ace, 0x0acf, + 0x0ad1, 0x0adf, + 0x0ae4, 0x0ae5, + 0x0af0, 0x0af0, + 0x0af2, 0x0b00, + 0x0b04, 0x0b04, + 0x0b0d, 0x0b0e, + 0x0b11, 0x0b12, + 0x0b29, 0x0b29, + 0x0b31, 0x0b31, + 0x0b34, 0x0b34, + 0x0b3a, 0x0b3b, + 0x0b45, 0x0b46, + 0x0b49, 0x0b4a, + 0x0b4e, 0x0b55, + 0x0b58, 0x0b5b, + 0x0b5e, 0x0b5e, + 0x0b64, 0x0b65, + 0x0b72, 0x0b81, + 0x0b84, 0x0b84, + 0x0b8b, 0x0b8d, + 0x0b91, 0x0b91, + 0x0b96, 0x0b98, + 0x0b9b, 0x0b9b, + 0x0b9d, 0x0b9d, + 0x0ba0, 0x0ba2, + 0x0ba5, 0x0ba7, + 0x0bab, 0x0bad, + 0x0bba, 0x0bbd, + 0x0bc3, 0x0bc5, + 0x0bc9, 0x0bc9, + 0x0bce, 0x0bcf, + 0x0bd1, 0x0bd6, + 0x0bd8, 0x0be5, + 0x0bfb, 0x0c00, + 0x0c04, 0x0c04, + 0x0c0d, 0x0c0d, + 0x0c11, 0x0c11, + 0x0c29, 0x0c29, + 0x0c34, 0x0c34, + 0x0c3a, 0x0c3c, + 0x0c45, 0x0c45, + 0x0c49, 0x0c49, + 0x0c4e, 0x0c54, + 0x0c57, 0x0c57, + 0x0c5a, 0x0c5f, + 0x0c64, 0x0c65, + 0x0c70, 0x0c77, + 0x0c80, 0x0c81, + 0x0c84, 0x0c84, + 0x0c8d, 0x0c8d, + 0x0c91, 0x0c91, + 0x0ca9, 0x0ca9, + 0x0cb4, 0x0cb4, + 0x0cba, 0x0cbb, + 0x0cc5, 0x0cc5, + 0x0cc9, 0x0cc9, + 0x0cce, 0x0cd4, + 0x0cd7, 0x0cdd, + 0x0cdf, 0x0cdf, + 0x0ce4, 0x0ce5, + 0x0cf0, 0x0cf0, + 0x0cf3, 0x0d01, + 0x0d04, 0x0d04, + 0x0d0d, 0x0d0d, + 0x0d11, 0x0d11, + 0x0d29, 0x0d29, + 0x0d3a, 0x0d3c, + 0x0d45, 0x0d45, + 0x0d49, 0x0d49, + 0x0d4e, 0x0d56, + 0x0d58, 0x0d5f, + 0x0d64, 0x0d65, + 0x0d76, 0x0d78, + 0x0d80, 0x0d81, + 0x0d84, 0x0d84, + 0x0d97, 0x0d99, + 0x0db2, 0x0db2, + 0x0dbc, 0x0dbc, + 0x0dbe, 0x0dbf, + 0x0dc7, 0x0dc9, + 0x0dcb, 0x0dce, + 0x0dd5, 0x0dd5, + 0x0dd7, 0x0dd7, + 0x0de0, 0x0df1, + 0x0df5, 0x0e00, + 0x0e3b, 0x0e3e, + 0x0e5c, 0x0e80, + 0x0e83, 0x0e83, + 0x0e85, 0x0e86, + 0x0e89, 0x0e89, + 0x0e8b, 0x0e8c, + 0x0e8e, 0x0e93, + 0x0e98, 0x0e98, + 0x0ea0, 0x0ea0, + 0x0ea4, 0x0ea4, + 0x0ea6, 0x0ea6, + 0x0ea8, 0x0ea9, + 0x0eac, 0x0eac, + 0x0eba, 0x0eba, + 0x0ebe, 0x0ebf, + 0x0ec5, 0x0ec5, + 0x0ec7, 0x0ec7, + 0x0ece, 0x0ecf, + 0x0eda, 0x0edb, + 0x0ede, 0x0eff, + 0x0f48, 0x0f48, + 0x0f6d, 0x0f70, + 0x0f8c, 0x0f8f, + 0x0f98, 0x0f98, + 0x0fbd, 0x0fbd, + 0x0fcd, 0x0fcd, + 0x0fd9, 0x0fff, + 0x10c6, 0x10cf, + 0x10fd, 0x10ff, + 0x1249, 0x1249, + 0x124e, 0x124f, + 0x1257, 0x1257, + 0x1259, 0x1259, + 0x125e, 0x125f, + 0x1289, 0x1289, + 0x128e, 0x128f, + 0x12b1, 0x12b1, + 0x12b6, 0x12b7, + 0x12bf, 0x12bf, + 0x12c1, 0x12c1, + 0x12c6, 0x12c7, + 0x12d7, 0x12d7, + 0x1311, 0x1311, + 0x1316, 0x1317, + 0x135b, 0x135e, + 0x137d, 0x137f, + 0x139a, 0x139f, + 0x13f5, 0x13ff, + 0x169d, 0x169f, + 0x16f1, 0x16ff, + 0x170d, 0x170d, + 0x1715, 0x171f, + 0x1737, 0x173f, + 0x1754, 0x175f, + 0x176d, 0x176d, + 0x1771, 0x1771, + 0x1774, 0x177f, + 0x17de, 0x17df, + 0x17ea, 0x17ef, + 0x17fa, 0x17ff, + 0x180f, 0x180f, + 0x181a, 0x181f, + 0x1878, 0x187f, + 0x18ab, 0x18af, + 0x18f6, 0x18ff, + 0x191d, 0x191f, + 0x192c, 0x192f, + 0x193c, 0x193f, + 0x1941, 0x1943, + 0x196e, 0x196f, + 0x1975, 0x197f, + 0x19ac, 0x19af, + 0x19ca, 0x19cf, + 0x19db, 0x19dd, + 0x1a1c, 0x1a1d, + 0x1a5f, 0x1a5f, + 0x1a7d, 0x1a7e, + 0x1a8a, 0x1a8f, + 0x1a9a, 0x1a9f, + 0x1aae, 0x1aff, + 0x1b4c, 0x1b4f, + 0x1b7d, 0x1b7f, + 0x1bab, 0x1bad, + 0x1bba, 0x1bff, + 0x1c38, 0x1c3a, + 0x1c4a, 0x1c4c, + 0x1c80, 0x1ccf, + 0x1cf3, 0x1cff, + 0x1de7, 0x1dfc, + 0x1f16, 0x1f17, + 0x1f1e, 0x1f1f, + 0x1f46, 0x1f47, + 0x1f4e, 0x1f4f, + 0x1f58, 0x1f58, + 0x1f5a, 0x1f5a, + 0x1f5c, 0x1f5c, + 0x1f5e, 0x1f5e, + 0x1f7e, 0x1f7f, + 0x1fb5, 0x1fb5, + 0x1fc5, 0x1fc5, + 0x1fd4, 0x1fd5, + 0x1fdc, 0x1fdc, + 0x1ff0, 0x1ff1, + 0x1ff5, 0x1ff5, + 0x1fff, 0x1fff, + 0x2065, 0x2069, + 0x2072, 0x2073, + 0x208f, 0x208f, + 0x2095, 0x209f, + 0x20b9, 0x20cf, + 0x20f1, 0x20ff, + 0x218a, 0x218f, + 0x23e9, 0x23ff, + 0x2427, 0x243f, + 0x244b, 0x245f, + 0x26ce, 0x26ce, + 0x26e2, 0x26e2, + 0x26e4, 0x26e7, + 0x2700, 0x2700, + 0x2705, 0x2705, + 0x270a, 0x270b, + 0x2728, 0x2728, + 0x274c, 0x274c, + 0x274e, 0x274e, + 0x2753, 0x2755, + 0x275f, 0x2760, + 0x2795, 0x2797, + 0x27b0, 0x27b0, + 0x27bf, 0x27bf, + 0x27cb, 0x27cb, + 0x27cd, 0x27cf, + 0x2b4d, 0x2b4f, + 0x2b5a, 0x2bff, + 0x2c2f, 0x2c2f, + 0x2c5f, 0x2c5f, + 0x2cf2, 0x2cf8, + 0x2d26, 0x2d2f, + 0x2d66, 0x2d6e, + 0x2d70, 0x2d7f, + 0x2d97, 0x2d9f, + 0x2da7, 0x2da7, + 0x2daf, 0x2daf, + 0x2db7, 0x2db7, + 0x2dbf, 0x2dbf, + 0x2dc7, 0x2dc7, + 0x2dcf, 0x2dcf, + 0x2dd7, 0x2dd7, + 0x2ddf, 0x2ddf, + 0x2e32, 0x2e7f, + 0x2e9a, 0x2e9a, + 0x2ef4, 0x2eff, + 0x2fd6, 0x2fef, + 0x2ffc, 0x2fff, + 0x3040, 0x3040, + 0x3097, 0x3098, + 0x3100, 0x3104, + 0x312e, 0x3130, + 0x318f, 0x318f, + 0x31b8, 0x31bf, + 0x31e4, 0x31ef, + 0x321f, 0x321f, + 0x32ff, 0x32ff, + 0x4db6, 0x4dbf, + 0x9fcc, 0x9fff, + 0xa48d, 0xa48f, + 0xa4c7, 0xa4cf, + 0xa62c, 0xa63f, + 0xa660, 0xa661, + 0xa674, 0xa67b, + 0xa698, 0xa69f, + 0xa6f8, 0xa6ff, + 0xa78d, 0xa7fa, + 0xa82c, 0xa82f, + 0xa83a, 0xa83f, + 0xa878, 0xa87f, + 0xa8c5, 0xa8cd, + 0xa8da, 0xa8df, + 0xa8fc, 0xa8ff, + 0xa954, 0xa95e, + 0xa97d, 0xa97f, + 0xa9ce, 0xa9ce, + 0xa9da, 0xa9dd, + 0xa9e0, 0xa9ff, + 0xaa37, 0xaa3f, + 0xaa4e, 0xaa4f, + 0xaa5a, 0xaa5b, + 0xaa7c, 0xaa7f, + 0xaac3, 0xaada, + 0xaae0, 0xabbf, + 0xabee, 0xabef, + 0xabfa, 0xabff, + 0xd7a4, 0xd7af, + 0xd7c7, 0xd7ca, + 0xd7fc, 0xd7ff, + 0xfa2e, 0xfa2f, + 0xfa6e, 0xfa6f, + 0xfada, 0xfaff, + 0xfb07, 0xfb12, + 0xfb18, 0xfb1c, + 0xfb37, 0xfb37, + 0xfb3d, 0xfb3d, + 0xfb3f, 0xfb3f, + 0xfb42, 0xfb42, + 0xfb45, 0xfb45, + 0xfbb2, 0xfbd2, + 0xfd40, 0xfd4f, + 0xfd90, 0xfd91, + 0xfdc8, 0xfdef, + 0xfdfe, 0xfdff, + 0xfe1a, 0xfe1f, + 0xfe27, 0xfe2f, + 0xfe53, 0xfe53, + 0xfe67, 0xfe67, + 0xfe6c, 0xfe6f, + 0xfe75, 0xfe75, + 0xfefd, 0xfefe, + 0xff00, 0xff00, + 0xffbf, 0xffc1, + 0xffc8, 0xffc9, + 0xffd0, 0xffd1, + 0xffd8, 0xffd9, + 0xffdd, 0xffdf, + 0xffe7, 0xffe7, + 0xffef, 0xfff8, + 0xfffe, 0xffff, + 0x1000c, 0x1000c, + 0x10027, 0x10027, + 0x1003b, 0x1003b, + 0x1003e, 0x1003e, + 0x1004e, 0x1004f, + 0x1005e, 0x1007f, + 0x100fb, 0x100ff, + 0x10103, 0x10106, + 0x10134, 0x10136, + 0x1018b, 0x1018f, + 0x1019c, 0x101cf, + 0x101fe, 0x1027f, + 0x1029d, 0x1029f, + 0x102d1, 0x102ff, + 0x1031f, 0x1031f, + 0x10324, 0x1032f, + 0x1034b, 0x1037f, + 0x1039e, 0x1039e, + 0x103c4, 0x103c7, + 0x103d6, 0x103ff, + 0x1049e, 0x1049f, + 0x104aa, 0x107ff, + 0x10806, 0x10807, + 0x10809, 0x10809, + 0x10836, 0x10836, + 0x10839, 0x1083b, + 0x1083d, 0x1083e, + 0x10856, 0x10856, + 0x10860, 0x108ff, + 0x1091c, 0x1091e, + 0x1093a, 0x1093e, + 0x10940, 0x109ff, + 0x10a04, 0x10a04, + 0x10a07, 0x10a0b, + 0x10a14, 0x10a14, + 0x10a18, 0x10a18, + 0x10a34, 0x10a37, + 0x10a3b, 0x10a3e, + 0x10a48, 0x10a4f, + 0x10a59, 0x10a5f, + 0x10a80, 0x10aff, + 0x10b36, 0x10b38, + 0x10b56, 0x10b57, + 0x10b73, 0x10b77, + 0x10b80, 0x10bff, + 0x10c49, 0x10e5f, + 0x10e7f, 0x1107f, + 0x110c2, 0x11fff, + 0x1236f, 0x123ff, + 0x12463, 0x1246f, + 0x12474, 0x12fff, + 0x1342f, 0x1cfff, + 0x1d0f6, 0x1d0ff, + 0x1d127, 0x1d128, + 0x1d1de, 0x1d1ff, + 0x1d246, 0x1d2ff, + 0x1d357, 0x1d35f, + 0x1d372, 0x1d3ff, + 0x1d455, 0x1d455, + 0x1d49d, 0x1d49d, + 0x1d4a0, 0x1d4a1, + 0x1d4a3, 0x1d4a4, + 0x1d4a7, 0x1d4a8, + 0x1d4ad, 0x1d4ad, + 0x1d4ba, 0x1d4ba, + 0x1d4bc, 0x1d4bc, + 0x1d4c4, 0x1d4c4, + 0x1d506, 0x1d506, + 0x1d50b, 0x1d50c, + 0x1d515, 0x1d515, + 0x1d51d, 0x1d51d, + 0x1d53a, 0x1d53a, + 0x1d53f, 0x1d53f, + 0x1d545, 0x1d545, + 0x1d547, 0x1d549, + 0x1d551, 0x1d551, + 0x1d6a6, 0x1d6a7, + 0x1d7cc, 0x1d7cd, + 0x1d800, 0x1efff, + 0x1f02c, 0x1f02f, + 0x1f094, 0x1f0ff, + 0x1f10b, 0x1f10f, + 0x1f12f, 0x1f130, + 0x1f132, 0x1f13c, + 0x1f13e, 0x1f13e, + 0x1f140, 0x1f141, + 0x1f143, 0x1f145, + 0x1f147, 0x1f149, + 0x1f14f, 0x1f156, + 0x1f158, 0x1f15e, + 0x1f160, 0x1f178, + 0x1f17a, 0x1f17a, + 0x1f17d, 0x1f17e, + 0x1f180, 0x1f189, + 0x1f18e, 0x1f18f, + 0x1f191, 0x1f1ff, + 0x1f201, 0x1f20f, + 0x1f232, 0x1f23f, + 0x1f249, 0x1ffff, + 0x2a6d7, 0x2a6ff, + 0x2b735, 0x2f7ff, + 0x2fa1e, 0xe0000, + 0xe0002, 0xe001f, + 0xe0080, 0xe00ff, + 0xe01f0, 0xeffff, + 0xffffe, 0xfffff, + 0x10fffe, 0x10ffff, +}; /* CR_Cn */ + +/* 'Co': General Category */ +static const OnigCodePoint CR_Co[] = { + 3, + 0xe000, 0xf8ff, + 0xf0000, 0xffffd, + 0x100000, 0x10fffd, +}; /* CR_Co */ + +/* 'Cs': General Category */ +static const OnigCodePoint CR_Cs[] = { + 1, + 0xd800, 0xdfff, +}; /* CR_Cs */ + +/* 'L': Major Category */ +static const OnigCodePoint CR_L[] = { + 422, + 0x0041, 0x005a, + 0x0061, 0x007a, + 0x00aa, 0x00aa, + 0x00b5, 0x00b5, + 0x00ba, 0x00ba, + 0x00c0, 0x00d6, + 0x00d8, 0x00f6, + 0x00f8, 0x02c1, + 0x02c6, 0x02d1, + 0x02e0, 0x02e4, + 0x02ec, 0x02ec, + 0x02ee, 0x02ee, + 0x0370, 0x0374, + 0x0376, 0x0377, + 0x037a, 0x037d, + 0x0386, 0x0386, + 0x0388, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x03a1, + 0x03a3, 0x03f5, + 0x03f7, 0x0481, + 0x048a, 0x0525, + 0x0531, 0x0556, + 0x0559, 0x0559, + 0x0561, 0x0587, + 0x05d0, 0x05ea, + 0x05f0, 0x05f2, + 0x0621, 0x064a, + 0x066e, 0x066f, + 0x0671, 0x06d3, + 0x06d5, 0x06d5, + 0x06e5, 0x06e6, + 0x06ee, 0x06ef, + 0x06fa, 0x06fc, + 0x06ff, 0x06ff, + 0x0710, 0x0710, + 0x0712, 0x072f, + 0x074d, 0x07a5, + 0x07b1, 0x07b1, + 0x07ca, 0x07ea, + 0x07f4, 0x07f5, + 0x07fa, 0x07fa, + 0x0800, 0x0815, + 0x081a, 0x081a, + 0x0824, 0x0824, + 0x0828, 0x0828, + 0x0904, 0x0939, + 0x093d, 0x093d, + 0x0950, 0x0950, + 0x0958, 0x0961, + 0x0971, 0x0972, + 0x0979, 0x097f, + 0x0985, 0x098c, + 0x098f, 0x0990, + 0x0993, 0x09a8, + 0x09aa, 0x09b0, + 0x09b2, 0x09b2, + 0x09b6, 0x09b9, + 0x09bd, 0x09bd, + 0x09ce, 0x09ce, + 0x09dc, 0x09dd, + 0x09df, 0x09e1, + 0x09f0, 0x09f1, + 0x0a05, 0x0a0a, + 0x0a0f, 0x0a10, + 0x0a13, 0x0a28, + 0x0a2a, 0x0a30, + 0x0a32, 0x0a33, + 0x0a35, 0x0a36, + 0x0a38, 0x0a39, + 0x0a59, 0x0a5c, + 0x0a5e, 0x0a5e, + 0x0a72, 0x0a74, + 0x0a85, 0x0a8d, + 0x0a8f, 0x0a91, + 0x0a93, 0x0aa8, + 0x0aaa, 0x0ab0, + 0x0ab2, 0x0ab3, + 0x0ab5, 0x0ab9, + 0x0abd, 0x0abd, + 0x0ad0, 0x0ad0, + 0x0ae0, 0x0ae1, + 0x0b05, 0x0b0c, + 0x0b0f, 0x0b10, + 0x0b13, 0x0b28, + 0x0b2a, 0x0b30, + 0x0b32, 0x0b33, + 0x0b35, 0x0b39, + 0x0b3d, 0x0b3d, + 0x0b5c, 0x0b5d, + 0x0b5f, 0x0b61, + 0x0b71, 0x0b71, + 0x0b83, 0x0b83, + 0x0b85, 0x0b8a, + 0x0b8e, 0x0b90, + 0x0b92, 0x0b95, + 0x0b99, 0x0b9a, + 0x0b9c, 0x0b9c, + 0x0b9e, 0x0b9f, + 0x0ba3, 0x0ba4, + 0x0ba8, 0x0baa, + 0x0bae, 0x0bb9, + 0x0bd0, 0x0bd0, + 0x0c05, 0x0c0c, + 0x0c0e, 0x0c10, + 0x0c12, 0x0c28, + 0x0c2a, 0x0c33, + 0x0c35, 0x0c39, + 0x0c3d, 0x0c3d, + 0x0c58, 0x0c59, + 0x0c60, 0x0c61, + 0x0c85, 0x0c8c, + 0x0c8e, 0x0c90, + 0x0c92, 0x0ca8, + 0x0caa, 0x0cb3, + 0x0cb5, 0x0cb9, + 0x0cbd, 0x0cbd, + 0x0cde, 0x0cde, + 0x0ce0, 0x0ce1, + 0x0d05, 0x0d0c, + 0x0d0e, 0x0d10, + 0x0d12, 0x0d28, + 0x0d2a, 0x0d39, + 0x0d3d, 0x0d3d, + 0x0d60, 0x0d61, + 0x0d7a, 0x0d7f, + 0x0d85, 0x0d96, + 0x0d9a, 0x0db1, + 0x0db3, 0x0dbb, + 0x0dbd, 0x0dbd, + 0x0dc0, 0x0dc6, + 0x0e01, 0x0e30, + 0x0e32, 0x0e33, + 0x0e40, 0x0e46, + 0x0e81, 0x0e82, + 0x0e84, 0x0e84, + 0x0e87, 0x0e88, + 0x0e8a, 0x0e8a, + 0x0e8d, 0x0e8d, + 0x0e94, 0x0e97, + 0x0e99, 0x0e9f, + 0x0ea1, 0x0ea3, + 0x0ea5, 0x0ea5, + 0x0ea7, 0x0ea7, + 0x0eaa, 0x0eab, + 0x0ead, 0x0eb0, + 0x0eb2, 0x0eb3, + 0x0ebd, 0x0ebd, + 0x0ec0, 0x0ec4, + 0x0ec6, 0x0ec6, + 0x0edc, 0x0edd, + 0x0f00, 0x0f00, + 0x0f40, 0x0f47, + 0x0f49, 0x0f6c, + 0x0f88, 0x0f8b, + 0x1000, 0x102a, + 0x103f, 0x103f, + 0x1050, 0x1055, + 0x105a, 0x105d, + 0x1061, 0x1061, + 0x1065, 0x1066, + 0x106e, 0x1070, + 0x1075, 0x1081, + 0x108e, 0x108e, + 0x10a0, 0x10c5, + 0x10d0, 0x10fa, + 0x10fc, 0x10fc, + 0x1100, 0x1248, + 0x124a, 0x124d, + 0x1250, 0x1256, + 0x1258, 0x1258, + 0x125a, 0x125d, + 0x1260, 0x1288, + 0x128a, 0x128d, + 0x1290, 0x12b0, + 0x12b2, 0x12b5, + 0x12b8, 0x12be, + 0x12c0, 0x12c0, + 0x12c2, 0x12c5, + 0x12c8, 0x12d6, + 0x12d8, 0x1310, + 0x1312, 0x1315, + 0x1318, 0x135a, + 0x1380, 0x138f, + 0x13a0, 0x13f4, + 0x1401, 0x166c, + 0x166f, 0x167f, + 0x1681, 0x169a, + 0x16a0, 0x16ea, + 0x1700, 0x170c, + 0x170e, 0x1711, + 0x1720, 0x1731, + 0x1740, 0x1751, + 0x1760, 0x176c, + 0x176e, 0x1770, + 0x1780, 0x17b3, + 0x17d7, 0x17d7, + 0x17dc, 0x17dc, + 0x1820, 0x1877, + 0x1880, 0x18a8, + 0x18aa, 0x18aa, + 0x18b0, 0x18f5, + 0x1900, 0x191c, + 0x1950, 0x196d, + 0x1970, 0x1974, + 0x1980, 0x19ab, + 0x19c1, 0x19c7, + 0x1a00, 0x1a16, + 0x1a20, 0x1a54, + 0x1aa7, 0x1aa7, + 0x1b05, 0x1b33, + 0x1b45, 0x1b4b, + 0x1b83, 0x1ba0, + 0x1bae, 0x1baf, + 0x1c00, 0x1c23, + 0x1c4d, 0x1c4f, + 0x1c5a, 0x1c7d, + 0x1ce9, 0x1cec, + 0x1cee, 0x1cf1, + 0x1d00, 0x1dbf, + 0x1e00, 0x1f15, + 0x1f18, 0x1f1d, + 0x1f20, 0x1f45, + 0x1f48, 0x1f4d, + 0x1f50, 0x1f57, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f7d, + 0x1f80, 0x1fb4, + 0x1fb6, 0x1fbc, + 0x1fbe, 0x1fbe, + 0x1fc2, 0x1fc4, + 0x1fc6, 0x1fcc, + 0x1fd0, 0x1fd3, + 0x1fd6, 0x1fdb, + 0x1fe0, 0x1fec, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ffc, + 0x2071, 0x2071, + 0x207f, 0x207f, + 0x2090, 0x2094, + 0x2102, 0x2102, + 0x2107, 0x2107, + 0x210a, 0x2113, + 0x2115, 0x2115, + 0x2119, 0x211d, + 0x2124, 0x2124, + 0x2126, 0x2126, + 0x2128, 0x2128, + 0x212a, 0x212d, + 0x212f, 0x2139, + 0x213c, 0x213f, + 0x2145, 0x2149, + 0x214e, 0x214e, + 0x2183, 0x2184, + 0x2c00, 0x2c2e, + 0x2c30, 0x2c5e, + 0x2c60, 0x2ce4, + 0x2ceb, 0x2cee, + 0x2d00, 0x2d25, + 0x2d30, 0x2d65, + 0x2d6f, 0x2d6f, + 0x2d80, 0x2d96, + 0x2da0, 0x2da6, + 0x2da8, 0x2dae, + 0x2db0, 0x2db6, + 0x2db8, 0x2dbe, + 0x2dc0, 0x2dc6, + 0x2dc8, 0x2dce, + 0x2dd0, 0x2dd6, + 0x2dd8, 0x2dde, + 0x2e2f, 0x2e2f, + 0x3005, 0x3006, + 0x3031, 0x3035, + 0x303b, 0x303c, + 0x3041, 0x3096, + 0x309d, 0x309f, + 0x30a1, 0x30fa, + 0x30fc, 0x30ff, + 0x3105, 0x312d, + 0x3131, 0x318e, + 0x31a0, 0x31b7, + 0x31f0, 0x31ff, + 0x3400, 0x4db5, + 0x4e00, 0x9fcb, + 0xa000, 0xa48c, + 0xa4d0, 0xa4fd, + 0xa500, 0xa60c, + 0xa610, 0xa61f, + 0xa62a, 0xa62b, + 0xa640, 0xa65f, + 0xa662, 0xa66e, + 0xa67f, 0xa697, + 0xa6a0, 0xa6e5, + 0xa717, 0xa71f, + 0xa722, 0xa788, + 0xa78b, 0xa78c, + 0xa7fb, 0xa801, + 0xa803, 0xa805, + 0xa807, 0xa80a, + 0xa80c, 0xa822, + 0xa840, 0xa873, + 0xa882, 0xa8b3, + 0xa8f2, 0xa8f7, + 0xa8fb, 0xa8fb, + 0xa90a, 0xa925, + 0xa930, 0xa946, + 0xa960, 0xa97c, + 0xa984, 0xa9b2, + 0xa9cf, 0xa9cf, + 0xaa00, 0xaa28, + 0xaa40, 0xaa42, + 0xaa44, 0xaa4b, + 0xaa60, 0xaa76, + 0xaa7a, 0xaa7a, + 0xaa80, 0xaaaf, + 0xaab1, 0xaab1, + 0xaab5, 0xaab6, + 0xaab9, 0xaabd, + 0xaac0, 0xaac0, + 0xaac2, 0xaac2, + 0xaadb, 0xaadd, + 0xabc0, 0xabe2, + 0xac00, 0xd7a3, + 0xd7b0, 0xd7c6, + 0xd7cb, 0xd7fb, + 0xf900, 0xfa2d, + 0xfa30, 0xfa6d, + 0xfa70, 0xfad9, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xfb1d, 0xfb1d, + 0xfb1f, 0xfb28, + 0xfb2a, 0xfb36, + 0xfb38, 0xfb3c, + 0xfb3e, 0xfb3e, + 0xfb40, 0xfb41, + 0xfb43, 0xfb44, + 0xfb46, 0xfbb1, + 0xfbd3, 0xfd3d, + 0xfd50, 0xfd8f, + 0xfd92, 0xfdc7, + 0xfdf0, 0xfdfb, + 0xfe70, 0xfe74, + 0xfe76, 0xfefc, + 0xff21, 0xff3a, + 0xff41, 0xff5a, + 0xff66, 0xffbe, + 0xffc2, 0xffc7, + 0xffca, 0xffcf, + 0xffd2, 0xffd7, + 0xffda, 0xffdc, + 0x10000, 0x1000b, + 0x1000d, 0x10026, + 0x10028, 0x1003a, + 0x1003c, 0x1003d, + 0x1003f, 0x1004d, + 0x10050, 0x1005d, + 0x10080, 0x100fa, + 0x10280, 0x1029c, + 0x102a0, 0x102d0, + 0x10300, 0x1031e, + 0x10330, 0x10340, + 0x10342, 0x10349, + 0x10380, 0x1039d, + 0x103a0, 0x103c3, + 0x103c8, 0x103cf, + 0x10400, 0x1049d, + 0x10800, 0x10805, + 0x10808, 0x10808, + 0x1080a, 0x10835, + 0x10837, 0x10838, + 0x1083c, 0x1083c, + 0x1083f, 0x10855, + 0x10900, 0x10915, + 0x10920, 0x10939, + 0x10a00, 0x10a00, + 0x10a10, 0x10a13, + 0x10a15, 0x10a17, + 0x10a19, 0x10a33, + 0x10a60, 0x10a7c, + 0x10b00, 0x10b35, + 0x10b40, 0x10b55, + 0x10b60, 0x10b72, + 0x10c00, 0x10c48, + 0x11083, 0x110af, + 0x12000, 0x1236e, + 0x13000, 0x1342e, + 0x1d400, 0x1d454, + 0x1d456, 0x1d49c, + 0x1d49e, 0x1d49f, + 0x1d4a2, 0x1d4a2, + 0x1d4a5, 0x1d4a6, + 0x1d4a9, 0x1d4ac, + 0x1d4ae, 0x1d4b9, + 0x1d4bb, 0x1d4bb, + 0x1d4bd, 0x1d4c3, + 0x1d4c5, 0x1d505, + 0x1d507, 0x1d50a, + 0x1d50d, 0x1d514, + 0x1d516, 0x1d51c, + 0x1d51e, 0x1d539, + 0x1d53b, 0x1d53e, + 0x1d540, 0x1d544, + 0x1d546, 0x1d546, + 0x1d54a, 0x1d550, + 0x1d552, 0x1d6a5, + 0x1d6a8, 0x1d6c0, + 0x1d6c2, 0x1d6da, + 0x1d6dc, 0x1d6fa, + 0x1d6fc, 0x1d714, + 0x1d716, 0x1d734, + 0x1d736, 0x1d74e, + 0x1d750, 0x1d76e, + 0x1d770, 0x1d788, + 0x1d78a, 0x1d7a8, + 0x1d7aa, 0x1d7c2, + 0x1d7c4, 0x1d7cb, + 0x20000, 0x2a6d6, + 0x2a700, 0x2b734, + 0x2f800, 0x2fa1d, +}; /* CR_L */ + +/* 'Ll': General Category */ +static const OnigCodePoint CR_Ll[] = { + 599, + 0x0061, 0x007a, + 0x00aa, 0x00aa, + 0x00b5, 0x00b5, + 0x00ba, 0x00ba, + 0x00df, 0x00f6, + 0x00f8, 0x00ff, + 0x0101, 0x0101, + 0x0103, 0x0103, + 0x0105, 0x0105, + 0x0107, 0x0107, + 0x0109, 0x0109, + 0x010b, 0x010b, + 0x010d, 0x010d, + 0x010f, 0x010f, + 0x0111, 0x0111, + 0x0113, 0x0113, + 0x0115, 0x0115, + 0x0117, 0x0117, + 0x0119, 0x0119, + 0x011b, 0x011b, + 0x011d, 0x011d, + 0x011f, 0x011f, + 0x0121, 0x0121, + 0x0123, 0x0123, + 0x0125, 0x0125, + 0x0127, 0x0127, + 0x0129, 0x0129, + 0x012b, 0x012b, + 0x012d, 0x012d, + 0x012f, 0x012f, + 0x0131, 0x0131, + 0x0133, 0x0133, + 0x0135, 0x0135, + 0x0137, 0x0138, + 0x013a, 0x013a, + 0x013c, 0x013c, + 0x013e, 0x013e, + 0x0140, 0x0140, + 0x0142, 0x0142, + 0x0144, 0x0144, + 0x0146, 0x0146, + 0x0148, 0x0149, + 0x014b, 0x014b, + 0x014d, 0x014d, + 0x014f, 0x014f, + 0x0151, 0x0151, + 0x0153, 0x0153, + 0x0155, 0x0155, + 0x0157, 0x0157, + 0x0159, 0x0159, + 0x015b, 0x015b, + 0x015d, 0x015d, + 0x015f, 0x015f, + 0x0161, 0x0161, + 0x0163, 0x0163, + 0x0165, 0x0165, + 0x0167, 0x0167, + 0x0169, 0x0169, + 0x016b, 0x016b, + 0x016d, 0x016d, + 0x016f, 0x016f, + 0x0171, 0x0171, + 0x0173, 0x0173, + 0x0175, 0x0175, + 0x0177, 0x0177, + 0x017a, 0x017a, + 0x017c, 0x017c, + 0x017e, 0x0180, + 0x0183, 0x0183, + 0x0185, 0x0185, + 0x0188, 0x0188, + 0x018c, 0x018d, + 0x0192, 0x0192, + 0x0195, 0x0195, + 0x0199, 0x019b, + 0x019e, 0x019e, + 0x01a1, 0x01a1, + 0x01a3, 0x01a3, + 0x01a5, 0x01a5, + 0x01a8, 0x01a8, + 0x01aa, 0x01ab, + 0x01ad, 0x01ad, + 0x01b0, 0x01b0, + 0x01b4, 0x01b4, + 0x01b6, 0x01b6, + 0x01b9, 0x01ba, + 0x01bd, 0x01bf, + 0x01c6, 0x01c6, + 0x01c9, 0x01c9, + 0x01cc, 0x01cc, + 0x01ce, 0x01ce, + 0x01d0, 0x01d0, + 0x01d2, 0x01d2, + 0x01d4, 0x01d4, + 0x01d6, 0x01d6, + 0x01d8, 0x01d8, + 0x01da, 0x01da, + 0x01dc, 0x01dd, + 0x01df, 0x01df, + 0x01e1, 0x01e1, + 0x01e3, 0x01e3, + 0x01e5, 0x01e5, + 0x01e7, 0x01e7, + 0x01e9, 0x01e9, + 0x01eb, 0x01eb, + 0x01ed, 0x01ed, + 0x01ef, 0x01f0, + 0x01f3, 0x01f3, + 0x01f5, 0x01f5, + 0x01f9, 0x01f9, + 0x01fb, 0x01fb, + 0x01fd, 0x01fd, + 0x01ff, 0x01ff, + 0x0201, 0x0201, + 0x0203, 0x0203, + 0x0205, 0x0205, + 0x0207, 0x0207, + 0x0209, 0x0209, + 0x020b, 0x020b, + 0x020d, 0x020d, + 0x020f, 0x020f, + 0x0211, 0x0211, + 0x0213, 0x0213, + 0x0215, 0x0215, + 0x0217, 0x0217, + 0x0219, 0x0219, + 0x021b, 0x021b, + 0x021d, 0x021d, + 0x021f, 0x021f, + 0x0221, 0x0221, + 0x0223, 0x0223, + 0x0225, 0x0225, + 0x0227, 0x0227, + 0x0229, 0x0229, + 0x022b, 0x022b, + 0x022d, 0x022d, + 0x022f, 0x022f, + 0x0231, 0x0231, + 0x0233, 0x0239, + 0x023c, 0x023c, + 0x023f, 0x0240, + 0x0242, 0x0242, + 0x0247, 0x0247, + 0x0249, 0x0249, + 0x024b, 0x024b, + 0x024d, 0x024d, + 0x024f, 0x0293, + 0x0295, 0x02af, + 0x0371, 0x0371, + 0x0373, 0x0373, + 0x0377, 0x0377, + 0x037b, 0x037d, + 0x0390, 0x0390, + 0x03ac, 0x03ce, + 0x03d0, 0x03d1, + 0x03d5, 0x03d7, + 0x03d9, 0x03d9, + 0x03db, 0x03db, + 0x03dd, 0x03dd, + 0x03df, 0x03df, + 0x03e1, 0x03e1, + 0x03e3, 0x03e3, + 0x03e5, 0x03e5, + 0x03e7, 0x03e7, + 0x03e9, 0x03e9, + 0x03eb, 0x03eb, + 0x03ed, 0x03ed, + 0x03ef, 0x03f3, + 0x03f5, 0x03f5, + 0x03f8, 0x03f8, + 0x03fb, 0x03fc, + 0x0430, 0x045f, + 0x0461, 0x0461, + 0x0463, 0x0463, + 0x0465, 0x0465, + 0x0467, 0x0467, + 0x0469, 0x0469, + 0x046b, 0x046b, + 0x046d, 0x046d, + 0x046f, 0x046f, + 0x0471, 0x0471, + 0x0473, 0x0473, + 0x0475, 0x0475, + 0x0477, 0x0477, + 0x0479, 0x0479, + 0x047b, 0x047b, + 0x047d, 0x047d, + 0x047f, 0x047f, + 0x0481, 0x0481, + 0x048b, 0x048b, + 0x048d, 0x048d, + 0x048f, 0x048f, + 0x0491, 0x0491, + 0x0493, 0x0493, + 0x0495, 0x0495, + 0x0497, 0x0497, + 0x0499, 0x0499, + 0x049b, 0x049b, + 0x049d, 0x049d, + 0x049f, 0x049f, + 0x04a1, 0x04a1, + 0x04a3, 0x04a3, + 0x04a5, 0x04a5, + 0x04a7, 0x04a7, + 0x04a9, 0x04a9, + 0x04ab, 0x04ab, + 0x04ad, 0x04ad, + 0x04af, 0x04af, + 0x04b1, 0x04b1, + 0x04b3, 0x04b3, + 0x04b5, 0x04b5, + 0x04b7, 0x04b7, + 0x04b9, 0x04b9, + 0x04bb, 0x04bb, + 0x04bd, 0x04bd, + 0x04bf, 0x04bf, + 0x04c2, 0x04c2, + 0x04c4, 0x04c4, + 0x04c6, 0x04c6, + 0x04c8, 0x04c8, + 0x04ca, 0x04ca, + 0x04cc, 0x04cc, + 0x04ce, 0x04cf, + 0x04d1, 0x04d1, + 0x04d3, 0x04d3, + 0x04d5, 0x04d5, + 0x04d7, 0x04d7, + 0x04d9, 0x04d9, + 0x04db, 0x04db, + 0x04dd, 0x04dd, + 0x04df, 0x04df, + 0x04e1, 0x04e1, + 0x04e3, 0x04e3, + 0x04e5, 0x04e5, + 0x04e7, 0x04e7, + 0x04e9, 0x04e9, + 0x04eb, 0x04eb, + 0x04ed, 0x04ed, + 0x04ef, 0x04ef, + 0x04f1, 0x04f1, + 0x04f3, 0x04f3, + 0x04f5, 0x04f5, + 0x04f7, 0x04f7, + 0x04f9, 0x04f9, + 0x04fb, 0x04fb, + 0x04fd, 0x04fd, + 0x04ff, 0x04ff, + 0x0501, 0x0501, + 0x0503, 0x0503, + 0x0505, 0x0505, + 0x0507, 0x0507, + 0x0509, 0x0509, + 0x050b, 0x050b, + 0x050d, 0x050d, + 0x050f, 0x050f, + 0x0511, 0x0511, + 0x0513, 0x0513, + 0x0515, 0x0515, + 0x0517, 0x0517, + 0x0519, 0x0519, + 0x051b, 0x051b, + 0x051d, 0x051d, + 0x051f, 0x051f, + 0x0521, 0x0521, + 0x0523, 0x0523, + 0x0525, 0x0525, + 0x0561, 0x0587, + 0x1d00, 0x1d2b, + 0x1d62, 0x1d77, + 0x1d79, 0x1d9a, + 0x1e01, 0x1e01, + 0x1e03, 0x1e03, + 0x1e05, 0x1e05, + 0x1e07, 0x1e07, + 0x1e09, 0x1e09, + 0x1e0b, 0x1e0b, + 0x1e0d, 0x1e0d, + 0x1e0f, 0x1e0f, + 0x1e11, 0x1e11, + 0x1e13, 0x1e13, + 0x1e15, 0x1e15, + 0x1e17, 0x1e17, + 0x1e19, 0x1e19, + 0x1e1b, 0x1e1b, + 0x1e1d, 0x1e1d, + 0x1e1f, 0x1e1f, + 0x1e21, 0x1e21, + 0x1e23, 0x1e23, + 0x1e25, 0x1e25, + 0x1e27, 0x1e27, + 0x1e29, 0x1e29, + 0x1e2b, 0x1e2b, + 0x1e2d, 0x1e2d, + 0x1e2f, 0x1e2f, + 0x1e31, 0x1e31, + 0x1e33, 0x1e33, + 0x1e35, 0x1e35, + 0x1e37, 0x1e37, + 0x1e39, 0x1e39, + 0x1e3b, 0x1e3b, + 0x1e3d, 0x1e3d, + 0x1e3f, 0x1e3f, + 0x1e41, 0x1e41, + 0x1e43, 0x1e43, + 0x1e45, 0x1e45, + 0x1e47, 0x1e47, + 0x1e49, 0x1e49, + 0x1e4b, 0x1e4b, + 0x1e4d, 0x1e4d, + 0x1e4f, 0x1e4f, + 0x1e51, 0x1e51, + 0x1e53, 0x1e53, + 0x1e55, 0x1e55, + 0x1e57, 0x1e57, + 0x1e59, 0x1e59, + 0x1e5b, 0x1e5b, + 0x1e5d, 0x1e5d, + 0x1e5f, 0x1e5f, + 0x1e61, 0x1e61, + 0x1e63, 0x1e63, + 0x1e65, 0x1e65, + 0x1e67, 0x1e67, + 0x1e69, 0x1e69, + 0x1e6b, 0x1e6b, + 0x1e6d, 0x1e6d, + 0x1e6f, 0x1e6f, + 0x1e71, 0x1e71, + 0x1e73, 0x1e73, + 0x1e75, 0x1e75, + 0x1e77, 0x1e77, + 0x1e79, 0x1e79, + 0x1e7b, 0x1e7b, + 0x1e7d, 0x1e7d, + 0x1e7f, 0x1e7f, + 0x1e81, 0x1e81, + 0x1e83, 0x1e83, + 0x1e85, 0x1e85, + 0x1e87, 0x1e87, + 0x1e89, 0x1e89, + 0x1e8b, 0x1e8b, + 0x1e8d, 0x1e8d, + 0x1e8f, 0x1e8f, + 0x1e91, 0x1e91, + 0x1e93, 0x1e93, + 0x1e95, 0x1e9d, + 0x1e9f, 0x1e9f, + 0x1ea1, 0x1ea1, + 0x1ea3, 0x1ea3, + 0x1ea5, 0x1ea5, + 0x1ea7, 0x1ea7, + 0x1ea9, 0x1ea9, + 0x1eab, 0x1eab, + 0x1ead, 0x1ead, + 0x1eaf, 0x1eaf, + 0x1eb1, 0x1eb1, + 0x1eb3, 0x1eb3, + 0x1eb5, 0x1eb5, + 0x1eb7, 0x1eb7, + 0x1eb9, 0x1eb9, + 0x1ebb, 0x1ebb, + 0x1ebd, 0x1ebd, + 0x1ebf, 0x1ebf, + 0x1ec1, 0x1ec1, + 0x1ec3, 0x1ec3, + 0x1ec5, 0x1ec5, + 0x1ec7, 0x1ec7, + 0x1ec9, 0x1ec9, + 0x1ecb, 0x1ecb, + 0x1ecd, 0x1ecd, + 0x1ecf, 0x1ecf, + 0x1ed1, 0x1ed1, + 0x1ed3, 0x1ed3, + 0x1ed5, 0x1ed5, + 0x1ed7, 0x1ed7, + 0x1ed9, 0x1ed9, + 0x1edb, 0x1edb, + 0x1edd, 0x1edd, + 0x1edf, 0x1edf, + 0x1ee1, 0x1ee1, + 0x1ee3, 0x1ee3, + 0x1ee5, 0x1ee5, + 0x1ee7, 0x1ee7, + 0x1ee9, 0x1ee9, + 0x1eeb, 0x1eeb, + 0x1eed, 0x1eed, + 0x1eef, 0x1eef, + 0x1ef1, 0x1ef1, + 0x1ef3, 0x1ef3, + 0x1ef5, 0x1ef5, + 0x1ef7, 0x1ef7, + 0x1ef9, 0x1ef9, + 0x1efb, 0x1efb, + 0x1efd, 0x1efd, + 0x1eff, 0x1f07, + 0x1f10, 0x1f15, + 0x1f20, 0x1f27, + 0x1f30, 0x1f37, + 0x1f40, 0x1f45, + 0x1f50, 0x1f57, + 0x1f60, 0x1f67, + 0x1f70, 0x1f7d, + 0x1f80, 0x1f87, + 0x1f90, 0x1f97, + 0x1fa0, 0x1fa7, + 0x1fb0, 0x1fb4, + 0x1fb6, 0x1fb7, + 0x1fbe, 0x1fbe, + 0x1fc2, 0x1fc4, + 0x1fc6, 0x1fc7, + 0x1fd0, 0x1fd3, + 0x1fd6, 0x1fd7, + 0x1fe0, 0x1fe7, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ff7, + 0x210a, 0x210a, + 0x210e, 0x210f, + 0x2113, 0x2113, + 0x212f, 0x212f, + 0x2134, 0x2134, + 0x2139, 0x2139, + 0x213c, 0x213d, + 0x2146, 0x2149, + 0x214e, 0x214e, + 0x2184, 0x2184, + 0x2c30, 0x2c5e, + 0x2c61, 0x2c61, + 0x2c65, 0x2c66, + 0x2c68, 0x2c68, + 0x2c6a, 0x2c6a, + 0x2c6c, 0x2c6c, + 0x2c71, 0x2c71, + 0x2c73, 0x2c74, + 0x2c76, 0x2c7c, + 0x2c81, 0x2c81, + 0x2c83, 0x2c83, + 0x2c85, 0x2c85, + 0x2c87, 0x2c87, + 0x2c89, 0x2c89, + 0x2c8b, 0x2c8b, + 0x2c8d, 0x2c8d, + 0x2c8f, 0x2c8f, + 0x2c91, 0x2c91, + 0x2c93, 0x2c93, + 0x2c95, 0x2c95, + 0x2c97, 0x2c97, + 0x2c99, 0x2c99, + 0x2c9b, 0x2c9b, + 0x2c9d, 0x2c9d, + 0x2c9f, 0x2c9f, + 0x2ca1, 0x2ca1, + 0x2ca3, 0x2ca3, + 0x2ca5, 0x2ca5, + 0x2ca7, 0x2ca7, + 0x2ca9, 0x2ca9, + 0x2cab, 0x2cab, + 0x2cad, 0x2cad, + 0x2caf, 0x2caf, + 0x2cb1, 0x2cb1, + 0x2cb3, 0x2cb3, + 0x2cb5, 0x2cb5, + 0x2cb7, 0x2cb7, + 0x2cb9, 0x2cb9, + 0x2cbb, 0x2cbb, + 0x2cbd, 0x2cbd, + 0x2cbf, 0x2cbf, + 0x2cc1, 0x2cc1, + 0x2cc3, 0x2cc3, + 0x2cc5, 0x2cc5, + 0x2cc7, 0x2cc7, + 0x2cc9, 0x2cc9, + 0x2ccb, 0x2ccb, + 0x2ccd, 0x2ccd, + 0x2ccf, 0x2ccf, + 0x2cd1, 0x2cd1, + 0x2cd3, 0x2cd3, + 0x2cd5, 0x2cd5, + 0x2cd7, 0x2cd7, + 0x2cd9, 0x2cd9, + 0x2cdb, 0x2cdb, + 0x2cdd, 0x2cdd, + 0x2cdf, 0x2cdf, + 0x2ce1, 0x2ce1, + 0x2ce3, 0x2ce4, + 0x2cec, 0x2cec, + 0x2cee, 0x2cee, + 0x2d00, 0x2d25, + 0xa641, 0xa641, + 0xa643, 0xa643, + 0xa645, 0xa645, + 0xa647, 0xa647, + 0xa649, 0xa649, + 0xa64b, 0xa64b, + 0xa64d, 0xa64d, + 0xa64f, 0xa64f, + 0xa651, 0xa651, + 0xa653, 0xa653, + 0xa655, 0xa655, + 0xa657, 0xa657, + 0xa659, 0xa659, + 0xa65b, 0xa65b, + 0xa65d, 0xa65d, + 0xa65f, 0xa65f, + 0xa663, 0xa663, + 0xa665, 0xa665, + 0xa667, 0xa667, + 0xa669, 0xa669, + 0xa66b, 0xa66b, + 0xa66d, 0xa66d, + 0xa681, 0xa681, + 0xa683, 0xa683, + 0xa685, 0xa685, + 0xa687, 0xa687, + 0xa689, 0xa689, + 0xa68b, 0xa68b, + 0xa68d, 0xa68d, + 0xa68f, 0xa68f, + 0xa691, 0xa691, + 0xa693, 0xa693, + 0xa695, 0xa695, + 0xa697, 0xa697, + 0xa723, 0xa723, + 0xa725, 0xa725, + 0xa727, 0xa727, + 0xa729, 0xa729, + 0xa72b, 0xa72b, + 0xa72d, 0xa72d, + 0xa72f, 0xa731, + 0xa733, 0xa733, + 0xa735, 0xa735, + 0xa737, 0xa737, + 0xa739, 0xa739, + 0xa73b, 0xa73b, + 0xa73d, 0xa73d, + 0xa73f, 0xa73f, + 0xa741, 0xa741, + 0xa743, 0xa743, + 0xa745, 0xa745, + 0xa747, 0xa747, + 0xa749, 0xa749, + 0xa74b, 0xa74b, + 0xa74d, 0xa74d, + 0xa74f, 0xa74f, + 0xa751, 0xa751, + 0xa753, 0xa753, + 0xa755, 0xa755, + 0xa757, 0xa757, + 0xa759, 0xa759, + 0xa75b, 0xa75b, + 0xa75d, 0xa75d, + 0xa75f, 0xa75f, + 0xa761, 0xa761, + 0xa763, 0xa763, + 0xa765, 0xa765, + 0xa767, 0xa767, + 0xa769, 0xa769, + 0xa76b, 0xa76b, + 0xa76d, 0xa76d, + 0xa76f, 0xa76f, + 0xa771, 0xa778, + 0xa77a, 0xa77a, + 0xa77c, 0xa77c, + 0xa77f, 0xa77f, + 0xa781, 0xa781, + 0xa783, 0xa783, + 0xa785, 0xa785, + 0xa787, 0xa787, + 0xa78c, 0xa78c, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xff41, 0xff5a, + 0x10428, 0x1044f, + 0x1d41a, 0x1d433, + 0x1d44e, 0x1d454, + 0x1d456, 0x1d467, + 0x1d482, 0x1d49b, + 0x1d4b6, 0x1d4b9, + 0x1d4bb, 0x1d4bb, + 0x1d4bd, 0x1d4c3, + 0x1d4c5, 0x1d4cf, + 0x1d4ea, 0x1d503, + 0x1d51e, 0x1d537, + 0x1d552, 0x1d56b, + 0x1d586, 0x1d59f, + 0x1d5ba, 0x1d5d3, + 0x1d5ee, 0x1d607, + 0x1d622, 0x1d63b, + 0x1d656, 0x1d66f, + 0x1d68a, 0x1d6a5, + 0x1d6c2, 0x1d6da, + 0x1d6dc, 0x1d6e1, + 0x1d6fc, 0x1d714, + 0x1d716, 0x1d71b, + 0x1d736, 0x1d74e, + 0x1d750, 0x1d755, + 0x1d770, 0x1d788, + 0x1d78a, 0x1d78f, + 0x1d7aa, 0x1d7c2, + 0x1d7c4, 0x1d7c9, + 0x1d7cb, 0x1d7cb, +}; /* CR_Ll */ + +/* 'Lm': General Category */ +static const OnigCodePoint CR_Lm[] = { + 49, + 0x02b0, 0x02c1, + 0x02c6, 0x02d1, + 0x02e0, 0x02e4, + 0x02ec, 0x02ec, + 0x02ee, 0x02ee, + 0x0374, 0x0374, + 0x037a, 0x037a, + 0x0559, 0x0559, + 0x0640, 0x0640, + 0x06e5, 0x06e6, + 0x07f4, 0x07f5, + 0x07fa, 0x07fa, + 0x081a, 0x081a, + 0x0824, 0x0824, + 0x0828, 0x0828, + 0x0971, 0x0971, + 0x0e46, 0x0e46, + 0x0ec6, 0x0ec6, + 0x10fc, 0x10fc, + 0x17d7, 0x17d7, + 0x1843, 0x1843, + 0x1aa7, 0x1aa7, + 0x1c78, 0x1c7d, + 0x1d2c, 0x1d61, + 0x1d78, 0x1d78, + 0x1d9b, 0x1dbf, + 0x2071, 0x2071, + 0x207f, 0x207f, + 0x2090, 0x2094, + 0x2c7d, 0x2c7d, + 0x2d6f, 0x2d6f, + 0x2e2f, 0x2e2f, + 0x3005, 0x3005, + 0x3031, 0x3035, + 0x303b, 0x303b, + 0x309d, 0x309e, + 0x30fc, 0x30fe, + 0xa015, 0xa015, + 0xa4f8, 0xa4fd, + 0xa60c, 0xa60c, + 0xa67f, 0xa67f, + 0xa717, 0xa71f, + 0xa770, 0xa770, + 0xa788, 0xa788, + 0xa9cf, 0xa9cf, + 0xaa70, 0xaa70, + 0xaadd, 0xaadd, + 0xff70, 0xff70, + 0xff9e, 0xff9f, +}; /* CR_Lm */ + +/* 'Lo': General Category */ +static const OnigCodePoint CR_Lo[] = { + 311, + 0x01bb, 0x01bb, + 0x01c0, 0x01c3, + 0x0294, 0x0294, + 0x05d0, 0x05ea, + 0x05f0, 0x05f2, + 0x0621, 0x063f, + 0x0641, 0x064a, + 0x066e, 0x066f, + 0x0671, 0x06d3, + 0x06d5, 0x06d5, + 0x06ee, 0x06ef, + 0x06fa, 0x06fc, + 0x06ff, 0x06ff, + 0x0710, 0x0710, + 0x0712, 0x072f, + 0x074d, 0x07a5, + 0x07b1, 0x07b1, + 0x07ca, 0x07ea, + 0x0800, 0x0815, + 0x0904, 0x0939, + 0x093d, 0x093d, + 0x0950, 0x0950, + 0x0958, 0x0961, + 0x0972, 0x0972, + 0x0979, 0x097f, + 0x0985, 0x098c, + 0x098f, 0x0990, + 0x0993, 0x09a8, + 0x09aa, 0x09b0, + 0x09b2, 0x09b2, + 0x09b6, 0x09b9, + 0x09bd, 0x09bd, + 0x09ce, 0x09ce, + 0x09dc, 0x09dd, + 0x09df, 0x09e1, + 0x09f0, 0x09f1, + 0x0a05, 0x0a0a, + 0x0a0f, 0x0a10, + 0x0a13, 0x0a28, + 0x0a2a, 0x0a30, + 0x0a32, 0x0a33, + 0x0a35, 0x0a36, + 0x0a38, 0x0a39, + 0x0a59, 0x0a5c, + 0x0a5e, 0x0a5e, + 0x0a72, 0x0a74, + 0x0a85, 0x0a8d, + 0x0a8f, 0x0a91, + 0x0a93, 0x0aa8, + 0x0aaa, 0x0ab0, + 0x0ab2, 0x0ab3, + 0x0ab5, 0x0ab9, + 0x0abd, 0x0abd, + 0x0ad0, 0x0ad0, + 0x0ae0, 0x0ae1, + 0x0b05, 0x0b0c, + 0x0b0f, 0x0b10, + 0x0b13, 0x0b28, + 0x0b2a, 0x0b30, + 0x0b32, 0x0b33, + 0x0b35, 0x0b39, + 0x0b3d, 0x0b3d, + 0x0b5c, 0x0b5d, + 0x0b5f, 0x0b61, + 0x0b71, 0x0b71, + 0x0b83, 0x0b83, + 0x0b85, 0x0b8a, + 0x0b8e, 0x0b90, + 0x0b92, 0x0b95, + 0x0b99, 0x0b9a, + 0x0b9c, 0x0b9c, + 0x0b9e, 0x0b9f, + 0x0ba3, 0x0ba4, + 0x0ba8, 0x0baa, + 0x0bae, 0x0bb9, + 0x0bd0, 0x0bd0, + 0x0c05, 0x0c0c, + 0x0c0e, 0x0c10, + 0x0c12, 0x0c28, + 0x0c2a, 0x0c33, + 0x0c35, 0x0c39, + 0x0c3d, 0x0c3d, + 0x0c58, 0x0c59, + 0x0c60, 0x0c61, + 0x0c85, 0x0c8c, + 0x0c8e, 0x0c90, + 0x0c92, 0x0ca8, + 0x0caa, 0x0cb3, + 0x0cb5, 0x0cb9, + 0x0cbd, 0x0cbd, + 0x0cde, 0x0cde, + 0x0ce0, 0x0ce1, + 0x0d05, 0x0d0c, + 0x0d0e, 0x0d10, + 0x0d12, 0x0d28, + 0x0d2a, 0x0d39, + 0x0d3d, 0x0d3d, + 0x0d60, 0x0d61, + 0x0d7a, 0x0d7f, + 0x0d85, 0x0d96, + 0x0d9a, 0x0db1, + 0x0db3, 0x0dbb, + 0x0dbd, 0x0dbd, + 0x0dc0, 0x0dc6, + 0x0e01, 0x0e30, + 0x0e32, 0x0e33, + 0x0e40, 0x0e45, + 0x0e81, 0x0e82, + 0x0e84, 0x0e84, + 0x0e87, 0x0e88, + 0x0e8a, 0x0e8a, + 0x0e8d, 0x0e8d, + 0x0e94, 0x0e97, + 0x0e99, 0x0e9f, + 0x0ea1, 0x0ea3, + 0x0ea5, 0x0ea5, + 0x0ea7, 0x0ea7, + 0x0eaa, 0x0eab, + 0x0ead, 0x0eb0, + 0x0eb2, 0x0eb3, + 0x0ebd, 0x0ebd, + 0x0ec0, 0x0ec4, + 0x0edc, 0x0edd, + 0x0f00, 0x0f00, + 0x0f40, 0x0f47, + 0x0f49, 0x0f6c, + 0x0f88, 0x0f8b, + 0x1000, 0x102a, + 0x103f, 0x103f, + 0x1050, 0x1055, + 0x105a, 0x105d, + 0x1061, 0x1061, + 0x1065, 0x1066, + 0x106e, 0x1070, + 0x1075, 0x1081, + 0x108e, 0x108e, + 0x10d0, 0x10fa, + 0x1100, 0x1248, + 0x124a, 0x124d, + 0x1250, 0x1256, + 0x1258, 0x1258, + 0x125a, 0x125d, + 0x1260, 0x1288, + 0x128a, 0x128d, + 0x1290, 0x12b0, + 0x12b2, 0x12b5, + 0x12b8, 0x12be, + 0x12c0, 0x12c0, + 0x12c2, 0x12c5, + 0x12c8, 0x12d6, + 0x12d8, 0x1310, + 0x1312, 0x1315, + 0x1318, 0x135a, + 0x1380, 0x138f, + 0x13a0, 0x13f4, + 0x1401, 0x166c, + 0x166f, 0x167f, + 0x1681, 0x169a, + 0x16a0, 0x16ea, + 0x1700, 0x170c, + 0x170e, 0x1711, + 0x1720, 0x1731, + 0x1740, 0x1751, + 0x1760, 0x176c, + 0x176e, 0x1770, + 0x1780, 0x17b3, + 0x17dc, 0x17dc, + 0x1820, 0x1842, + 0x1844, 0x1877, + 0x1880, 0x18a8, + 0x18aa, 0x18aa, + 0x18b0, 0x18f5, + 0x1900, 0x191c, + 0x1950, 0x196d, + 0x1970, 0x1974, + 0x1980, 0x19ab, + 0x19c1, 0x19c7, + 0x1a00, 0x1a16, + 0x1a20, 0x1a54, + 0x1b05, 0x1b33, + 0x1b45, 0x1b4b, + 0x1b83, 0x1ba0, + 0x1bae, 0x1baf, + 0x1c00, 0x1c23, + 0x1c4d, 0x1c4f, + 0x1c5a, 0x1c77, + 0x1ce9, 0x1cec, + 0x1cee, 0x1cf1, + 0x2135, 0x2138, + 0x2d30, 0x2d65, + 0x2d80, 0x2d96, + 0x2da0, 0x2da6, + 0x2da8, 0x2dae, + 0x2db0, 0x2db6, + 0x2db8, 0x2dbe, + 0x2dc0, 0x2dc6, + 0x2dc8, 0x2dce, + 0x2dd0, 0x2dd6, + 0x2dd8, 0x2dde, + 0x3006, 0x3006, + 0x303c, 0x303c, + 0x3041, 0x3096, + 0x309f, 0x309f, + 0x30a1, 0x30fa, + 0x30ff, 0x30ff, + 0x3105, 0x312d, + 0x3131, 0x318e, + 0x31a0, 0x31b7, + 0x31f0, 0x31ff, + 0x3400, 0x4db5, + 0x4e00, 0x9fcb, + 0xa000, 0xa014, + 0xa016, 0xa48c, + 0xa4d0, 0xa4f7, + 0xa500, 0xa60b, + 0xa610, 0xa61f, + 0xa62a, 0xa62b, + 0xa66e, 0xa66e, + 0xa6a0, 0xa6e5, + 0xa7fb, 0xa801, + 0xa803, 0xa805, + 0xa807, 0xa80a, + 0xa80c, 0xa822, + 0xa840, 0xa873, + 0xa882, 0xa8b3, + 0xa8f2, 0xa8f7, + 0xa8fb, 0xa8fb, + 0xa90a, 0xa925, + 0xa930, 0xa946, + 0xa960, 0xa97c, + 0xa984, 0xa9b2, + 0xaa00, 0xaa28, + 0xaa40, 0xaa42, + 0xaa44, 0xaa4b, + 0xaa60, 0xaa6f, + 0xaa71, 0xaa76, + 0xaa7a, 0xaa7a, + 0xaa80, 0xaaaf, + 0xaab1, 0xaab1, + 0xaab5, 0xaab6, + 0xaab9, 0xaabd, + 0xaac0, 0xaac0, + 0xaac2, 0xaac2, + 0xaadb, 0xaadc, + 0xabc0, 0xabe2, + 0xac00, 0xd7a3, + 0xd7b0, 0xd7c6, + 0xd7cb, 0xd7fb, + 0xf900, 0xfa2d, + 0xfa30, 0xfa6d, + 0xfa70, 0xfad9, + 0xfb1d, 0xfb1d, + 0xfb1f, 0xfb28, + 0xfb2a, 0xfb36, + 0xfb38, 0xfb3c, + 0xfb3e, 0xfb3e, + 0xfb40, 0xfb41, + 0xfb43, 0xfb44, + 0xfb46, 0xfbb1, + 0xfbd3, 0xfd3d, + 0xfd50, 0xfd8f, + 0xfd92, 0xfdc7, + 0xfdf0, 0xfdfb, + 0xfe70, 0xfe74, + 0xfe76, 0xfefc, + 0xff66, 0xff6f, + 0xff71, 0xff9d, + 0xffa0, 0xffbe, + 0xffc2, 0xffc7, + 0xffca, 0xffcf, + 0xffd2, 0xffd7, + 0xffda, 0xffdc, + 0x10000, 0x1000b, + 0x1000d, 0x10026, + 0x10028, 0x1003a, + 0x1003c, 0x1003d, + 0x1003f, 0x1004d, + 0x10050, 0x1005d, + 0x10080, 0x100fa, + 0x10280, 0x1029c, + 0x102a0, 0x102d0, + 0x10300, 0x1031e, + 0x10330, 0x10340, + 0x10342, 0x10349, + 0x10380, 0x1039d, + 0x103a0, 0x103c3, + 0x103c8, 0x103cf, + 0x10450, 0x1049d, + 0x10800, 0x10805, + 0x10808, 0x10808, + 0x1080a, 0x10835, + 0x10837, 0x10838, + 0x1083c, 0x1083c, + 0x1083f, 0x10855, + 0x10900, 0x10915, + 0x10920, 0x10939, + 0x10a00, 0x10a00, + 0x10a10, 0x10a13, + 0x10a15, 0x10a17, + 0x10a19, 0x10a33, + 0x10a60, 0x10a7c, + 0x10b00, 0x10b35, + 0x10b40, 0x10b55, + 0x10b60, 0x10b72, + 0x10c00, 0x10c48, + 0x11083, 0x110af, + 0x12000, 0x1236e, + 0x13000, 0x1342e, + 0x20000, 0x2a6d6, + 0x2a700, 0x2b734, + 0x2f800, 0x2fa1d, +}; /* CR_Lo */ + +/* 'Lt': General Category */ +static const OnigCodePoint CR_Lt[] = { + 10, + 0x01c5, 0x01c5, + 0x01c8, 0x01c8, + 0x01cb, 0x01cb, + 0x01f2, 0x01f2, + 0x1f88, 0x1f8f, + 0x1f98, 0x1f9f, + 0x1fa8, 0x1faf, + 0x1fbc, 0x1fbc, + 0x1fcc, 0x1fcc, + 0x1ffc, 0x1ffc, +}; /* CR_Lt */ + +/* 'Lu': General Category */ +static const OnigCodePoint CR_Lu[] = { + 594, + 0x0041, 0x005a, + 0x00c0, 0x00d6, + 0x00d8, 0x00de, + 0x0100, 0x0100, + 0x0102, 0x0102, + 0x0104, 0x0104, + 0x0106, 0x0106, + 0x0108, 0x0108, + 0x010a, 0x010a, + 0x010c, 0x010c, + 0x010e, 0x010e, + 0x0110, 0x0110, + 0x0112, 0x0112, + 0x0114, 0x0114, + 0x0116, 0x0116, + 0x0118, 0x0118, + 0x011a, 0x011a, + 0x011c, 0x011c, + 0x011e, 0x011e, + 0x0120, 0x0120, + 0x0122, 0x0122, + 0x0124, 0x0124, + 0x0126, 0x0126, + 0x0128, 0x0128, + 0x012a, 0x012a, + 0x012c, 0x012c, + 0x012e, 0x012e, + 0x0130, 0x0130, + 0x0132, 0x0132, + 0x0134, 0x0134, + 0x0136, 0x0136, + 0x0139, 0x0139, + 0x013b, 0x013b, + 0x013d, 0x013d, + 0x013f, 0x013f, + 0x0141, 0x0141, + 0x0143, 0x0143, + 0x0145, 0x0145, + 0x0147, 0x0147, + 0x014a, 0x014a, + 0x014c, 0x014c, + 0x014e, 0x014e, + 0x0150, 0x0150, + 0x0152, 0x0152, + 0x0154, 0x0154, + 0x0156, 0x0156, + 0x0158, 0x0158, + 0x015a, 0x015a, + 0x015c, 0x015c, + 0x015e, 0x015e, + 0x0160, 0x0160, + 0x0162, 0x0162, + 0x0164, 0x0164, + 0x0166, 0x0166, + 0x0168, 0x0168, + 0x016a, 0x016a, + 0x016c, 0x016c, + 0x016e, 0x016e, + 0x0170, 0x0170, + 0x0172, 0x0172, + 0x0174, 0x0174, + 0x0176, 0x0176, + 0x0178, 0x0179, + 0x017b, 0x017b, + 0x017d, 0x017d, + 0x0181, 0x0182, + 0x0184, 0x0184, + 0x0186, 0x0187, + 0x0189, 0x018b, + 0x018e, 0x0191, + 0x0193, 0x0194, + 0x0196, 0x0198, + 0x019c, 0x019d, + 0x019f, 0x01a0, + 0x01a2, 0x01a2, + 0x01a4, 0x01a4, + 0x01a6, 0x01a7, + 0x01a9, 0x01a9, + 0x01ac, 0x01ac, + 0x01ae, 0x01af, + 0x01b1, 0x01b3, + 0x01b5, 0x01b5, + 0x01b7, 0x01b8, + 0x01bc, 0x01bc, + 0x01c4, 0x01c4, + 0x01c7, 0x01c7, + 0x01ca, 0x01ca, + 0x01cd, 0x01cd, + 0x01cf, 0x01cf, + 0x01d1, 0x01d1, + 0x01d3, 0x01d3, + 0x01d5, 0x01d5, + 0x01d7, 0x01d7, + 0x01d9, 0x01d9, + 0x01db, 0x01db, + 0x01de, 0x01de, + 0x01e0, 0x01e0, + 0x01e2, 0x01e2, + 0x01e4, 0x01e4, + 0x01e6, 0x01e6, + 0x01e8, 0x01e8, + 0x01ea, 0x01ea, + 0x01ec, 0x01ec, + 0x01ee, 0x01ee, + 0x01f1, 0x01f1, + 0x01f4, 0x01f4, + 0x01f6, 0x01f8, + 0x01fa, 0x01fa, + 0x01fc, 0x01fc, + 0x01fe, 0x01fe, + 0x0200, 0x0200, + 0x0202, 0x0202, + 0x0204, 0x0204, + 0x0206, 0x0206, + 0x0208, 0x0208, + 0x020a, 0x020a, + 0x020c, 0x020c, + 0x020e, 0x020e, + 0x0210, 0x0210, + 0x0212, 0x0212, + 0x0214, 0x0214, + 0x0216, 0x0216, + 0x0218, 0x0218, + 0x021a, 0x021a, + 0x021c, 0x021c, + 0x021e, 0x021e, + 0x0220, 0x0220, + 0x0222, 0x0222, + 0x0224, 0x0224, + 0x0226, 0x0226, + 0x0228, 0x0228, + 0x022a, 0x022a, + 0x022c, 0x022c, + 0x022e, 0x022e, + 0x0230, 0x0230, + 0x0232, 0x0232, + 0x023a, 0x023b, + 0x023d, 0x023e, + 0x0241, 0x0241, + 0x0243, 0x0246, + 0x0248, 0x0248, + 0x024a, 0x024a, + 0x024c, 0x024c, + 0x024e, 0x024e, + 0x0370, 0x0370, + 0x0372, 0x0372, + 0x0376, 0x0376, + 0x0386, 0x0386, + 0x0388, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x038f, + 0x0391, 0x03a1, + 0x03a3, 0x03ab, + 0x03cf, 0x03cf, + 0x03d2, 0x03d4, + 0x03d8, 0x03d8, + 0x03da, 0x03da, + 0x03dc, 0x03dc, + 0x03de, 0x03de, + 0x03e0, 0x03e0, + 0x03e2, 0x03e2, + 0x03e4, 0x03e4, + 0x03e6, 0x03e6, + 0x03e8, 0x03e8, + 0x03ea, 0x03ea, + 0x03ec, 0x03ec, + 0x03ee, 0x03ee, + 0x03f4, 0x03f4, + 0x03f7, 0x03f7, + 0x03f9, 0x03fa, + 0x03fd, 0x042f, + 0x0460, 0x0460, + 0x0462, 0x0462, + 0x0464, 0x0464, + 0x0466, 0x0466, + 0x0468, 0x0468, + 0x046a, 0x046a, + 0x046c, 0x046c, + 0x046e, 0x046e, + 0x0470, 0x0470, + 0x0472, 0x0472, + 0x0474, 0x0474, + 0x0476, 0x0476, + 0x0478, 0x0478, + 0x047a, 0x047a, + 0x047c, 0x047c, + 0x047e, 0x047e, + 0x0480, 0x0480, + 0x048a, 0x048a, + 0x048c, 0x048c, + 0x048e, 0x048e, + 0x0490, 0x0490, + 0x0492, 0x0492, + 0x0494, 0x0494, + 0x0496, 0x0496, + 0x0498, 0x0498, + 0x049a, 0x049a, + 0x049c, 0x049c, + 0x049e, 0x049e, + 0x04a0, 0x04a0, + 0x04a2, 0x04a2, + 0x04a4, 0x04a4, + 0x04a6, 0x04a6, + 0x04a8, 0x04a8, + 0x04aa, 0x04aa, + 0x04ac, 0x04ac, + 0x04ae, 0x04ae, + 0x04b0, 0x04b0, + 0x04b2, 0x04b2, + 0x04b4, 0x04b4, + 0x04b6, 0x04b6, + 0x04b8, 0x04b8, + 0x04ba, 0x04ba, + 0x04bc, 0x04bc, + 0x04be, 0x04be, + 0x04c0, 0x04c1, + 0x04c3, 0x04c3, + 0x04c5, 0x04c5, + 0x04c7, 0x04c7, + 0x04c9, 0x04c9, + 0x04cb, 0x04cb, + 0x04cd, 0x04cd, + 0x04d0, 0x04d0, + 0x04d2, 0x04d2, + 0x04d4, 0x04d4, + 0x04d6, 0x04d6, + 0x04d8, 0x04d8, + 0x04da, 0x04da, + 0x04dc, 0x04dc, + 0x04de, 0x04de, + 0x04e0, 0x04e0, + 0x04e2, 0x04e2, + 0x04e4, 0x04e4, + 0x04e6, 0x04e6, + 0x04e8, 0x04e8, + 0x04ea, 0x04ea, + 0x04ec, 0x04ec, + 0x04ee, 0x04ee, + 0x04f0, 0x04f0, + 0x04f2, 0x04f2, + 0x04f4, 0x04f4, + 0x04f6, 0x04f6, + 0x04f8, 0x04f8, + 0x04fa, 0x04fa, + 0x04fc, 0x04fc, + 0x04fe, 0x04fe, + 0x0500, 0x0500, + 0x0502, 0x0502, + 0x0504, 0x0504, + 0x0506, 0x0506, + 0x0508, 0x0508, + 0x050a, 0x050a, + 0x050c, 0x050c, + 0x050e, 0x050e, + 0x0510, 0x0510, + 0x0512, 0x0512, + 0x0514, 0x0514, + 0x0516, 0x0516, + 0x0518, 0x0518, + 0x051a, 0x051a, + 0x051c, 0x051c, + 0x051e, 0x051e, + 0x0520, 0x0520, + 0x0522, 0x0522, + 0x0524, 0x0524, + 0x0531, 0x0556, + 0x10a0, 0x10c5, + 0x1e00, 0x1e00, + 0x1e02, 0x1e02, + 0x1e04, 0x1e04, + 0x1e06, 0x1e06, + 0x1e08, 0x1e08, + 0x1e0a, 0x1e0a, + 0x1e0c, 0x1e0c, + 0x1e0e, 0x1e0e, + 0x1e10, 0x1e10, + 0x1e12, 0x1e12, + 0x1e14, 0x1e14, + 0x1e16, 0x1e16, + 0x1e18, 0x1e18, + 0x1e1a, 0x1e1a, + 0x1e1c, 0x1e1c, + 0x1e1e, 0x1e1e, + 0x1e20, 0x1e20, + 0x1e22, 0x1e22, + 0x1e24, 0x1e24, + 0x1e26, 0x1e26, + 0x1e28, 0x1e28, + 0x1e2a, 0x1e2a, + 0x1e2c, 0x1e2c, + 0x1e2e, 0x1e2e, + 0x1e30, 0x1e30, + 0x1e32, 0x1e32, + 0x1e34, 0x1e34, + 0x1e36, 0x1e36, + 0x1e38, 0x1e38, + 0x1e3a, 0x1e3a, + 0x1e3c, 0x1e3c, + 0x1e3e, 0x1e3e, + 0x1e40, 0x1e40, + 0x1e42, 0x1e42, + 0x1e44, 0x1e44, + 0x1e46, 0x1e46, + 0x1e48, 0x1e48, + 0x1e4a, 0x1e4a, + 0x1e4c, 0x1e4c, + 0x1e4e, 0x1e4e, + 0x1e50, 0x1e50, + 0x1e52, 0x1e52, + 0x1e54, 0x1e54, + 0x1e56, 0x1e56, + 0x1e58, 0x1e58, + 0x1e5a, 0x1e5a, + 0x1e5c, 0x1e5c, + 0x1e5e, 0x1e5e, + 0x1e60, 0x1e60, + 0x1e62, 0x1e62, + 0x1e64, 0x1e64, + 0x1e66, 0x1e66, + 0x1e68, 0x1e68, + 0x1e6a, 0x1e6a, + 0x1e6c, 0x1e6c, + 0x1e6e, 0x1e6e, + 0x1e70, 0x1e70, + 0x1e72, 0x1e72, + 0x1e74, 0x1e74, + 0x1e76, 0x1e76, + 0x1e78, 0x1e78, + 0x1e7a, 0x1e7a, + 0x1e7c, 0x1e7c, + 0x1e7e, 0x1e7e, + 0x1e80, 0x1e80, + 0x1e82, 0x1e82, + 0x1e84, 0x1e84, + 0x1e86, 0x1e86, + 0x1e88, 0x1e88, + 0x1e8a, 0x1e8a, + 0x1e8c, 0x1e8c, + 0x1e8e, 0x1e8e, + 0x1e90, 0x1e90, + 0x1e92, 0x1e92, + 0x1e94, 0x1e94, + 0x1e9e, 0x1e9e, + 0x1ea0, 0x1ea0, + 0x1ea2, 0x1ea2, + 0x1ea4, 0x1ea4, + 0x1ea6, 0x1ea6, + 0x1ea8, 0x1ea8, + 0x1eaa, 0x1eaa, + 0x1eac, 0x1eac, + 0x1eae, 0x1eae, + 0x1eb0, 0x1eb0, + 0x1eb2, 0x1eb2, + 0x1eb4, 0x1eb4, + 0x1eb6, 0x1eb6, + 0x1eb8, 0x1eb8, + 0x1eba, 0x1eba, + 0x1ebc, 0x1ebc, + 0x1ebe, 0x1ebe, + 0x1ec0, 0x1ec0, + 0x1ec2, 0x1ec2, + 0x1ec4, 0x1ec4, + 0x1ec6, 0x1ec6, + 0x1ec8, 0x1ec8, + 0x1eca, 0x1eca, + 0x1ecc, 0x1ecc, + 0x1ece, 0x1ece, + 0x1ed0, 0x1ed0, + 0x1ed2, 0x1ed2, + 0x1ed4, 0x1ed4, + 0x1ed6, 0x1ed6, + 0x1ed8, 0x1ed8, + 0x1eda, 0x1eda, + 0x1edc, 0x1edc, + 0x1ede, 0x1ede, + 0x1ee0, 0x1ee0, + 0x1ee2, 0x1ee2, + 0x1ee4, 0x1ee4, + 0x1ee6, 0x1ee6, + 0x1ee8, 0x1ee8, + 0x1eea, 0x1eea, + 0x1eec, 0x1eec, + 0x1eee, 0x1eee, + 0x1ef0, 0x1ef0, + 0x1ef2, 0x1ef2, + 0x1ef4, 0x1ef4, + 0x1ef6, 0x1ef6, + 0x1ef8, 0x1ef8, + 0x1efa, 0x1efa, + 0x1efc, 0x1efc, + 0x1efe, 0x1efe, + 0x1f08, 0x1f0f, + 0x1f18, 0x1f1d, + 0x1f28, 0x1f2f, + 0x1f38, 0x1f3f, + 0x1f48, 0x1f4d, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f5f, + 0x1f68, 0x1f6f, + 0x1fb8, 0x1fbb, + 0x1fc8, 0x1fcb, + 0x1fd8, 0x1fdb, + 0x1fe8, 0x1fec, + 0x1ff8, 0x1ffb, + 0x2102, 0x2102, + 0x2107, 0x2107, + 0x210b, 0x210d, + 0x2110, 0x2112, + 0x2115, 0x2115, + 0x2119, 0x211d, + 0x2124, 0x2124, + 0x2126, 0x2126, + 0x2128, 0x2128, + 0x212a, 0x212d, + 0x2130, 0x2133, + 0x213e, 0x213f, + 0x2145, 0x2145, + 0x2183, 0x2183, + 0x2c00, 0x2c2e, + 0x2c60, 0x2c60, + 0x2c62, 0x2c64, + 0x2c67, 0x2c67, + 0x2c69, 0x2c69, + 0x2c6b, 0x2c6b, + 0x2c6d, 0x2c70, + 0x2c72, 0x2c72, + 0x2c75, 0x2c75, + 0x2c7e, 0x2c80, + 0x2c82, 0x2c82, + 0x2c84, 0x2c84, + 0x2c86, 0x2c86, + 0x2c88, 0x2c88, + 0x2c8a, 0x2c8a, + 0x2c8c, 0x2c8c, + 0x2c8e, 0x2c8e, + 0x2c90, 0x2c90, + 0x2c92, 0x2c92, + 0x2c94, 0x2c94, + 0x2c96, 0x2c96, + 0x2c98, 0x2c98, + 0x2c9a, 0x2c9a, + 0x2c9c, 0x2c9c, + 0x2c9e, 0x2c9e, + 0x2ca0, 0x2ca0, + 0x2ca2, 0x2ca2, + 0x2ca4, 0x2ca4, + 0x2ca6, 0x2ca6, + 0x2ca8, 0x2ca8, + 0x2caa, 0x2caa, + 0x2cac, 0x2cac, + 0x2cae, 0x2cae, + 0x2cb0, 0x2cb0, + 0x2cb2, 0x2cb2, + 0x2cb4, 0x2cb4, + 0x2cb6, 0x2cb6, + 0x2cb8, 0x2cb8, + 0x2cba, 0x2cba, + 0x2cbc, 0x2cbc, + 0x2cbe, 0x2cbe, + 0x2cc0, 0x2cc0, + 0x2cc2, 0x2cc2, + 0x2cc4, 0x2cc4, + 0x2cc6, 0x2cc6, + 0x2cc8, 0x2cc8, + 0x2cca, 0x2cca, + 0x2ccc, 0x2ccc, + 0x2cce, 0x2cce, + 0x2cd0, 0x2cd0, + 0x2cd2, 0x2cd2, + 0x2cd4, 0x2cd4, + 0x2cd6, 0x2cd6, + 0x2cd8, 0x2cd8, + 0x2cda, 0x2cda, + 0x2cdc, 0x2cdc, + 0x2cde, 0x2cde, + 0x2ce0, 0x2ce0, + 0x2ce2, 0x2ce2, + 0x2ceb, 0x2ceb, + 0x2ced, 0x2ced, + 0xa640, 0xa640, + 0xa642, 0xa642, + 0xa644, 0xa644, + 0xa646, 0xa646, + 0xa648, 0xa648, + 0xa64a, 0xa64a, + 0xa64c, 0xa64c, + 0xa64e, 0xa64e, + 0xa650, 0xa650, + 0xa652, 0xa652, + 0xa654, 0xa654, + 0xa656, 0xa656, + 0xa658, 0xa658, + 0xa65a, 0xa65a, + 0xa65c, 0xa65c, + 0xa65e, 0xa65e, + 0xa662, 0xa662, + 0xa664, 0xa664, + 0xa666, 0xa666, + 0xa668, 0xa668, + 0xa66a, 0xa66a, + 0xa66c, 0xa66c, + 0xa680, 0xa680, + 0xa682, 0xa682, + 0xa684, 0xa684, + 0xa686, 0xa686, + 0xa688, 0xa688, + 0xa68a, 0xa68a, + 0xa68c, 0xa68c, + 0xa68e, 0xa68e, + 0xa690, 0xa690, + 0xa692, 0xa692, + 0xa694, 0xa694, + 0xa696, 0xa696, + 0xa722, 0xa722, + 0xa724, 0xa724, + 0xa726, 0xa726, + 0xa728, 0xa728, + 0xa72a, 0xa72a, + 0xa72c, 0xa72c, + 0xa72e, 0xa72e, + 0xa732, 0xa732, + 0xa734, 0xa734, + 0xa736, 0xa736, + 0xa738, 0xa738, + 0xa73a, 0xa73a, + 0xa73c, 0xa73c, + 0xa73e, 0xa73e, + 0xa740, 0xa740, + 0xa742, 0xa742, + 0xa744, 0xa744, + 0xa746, 0xa746, + 0xa748, 0xa748, + 0xa74a, 0xa74a, + 0xa74c, 0xa74c, + 0xa74e, 0xa74e, + 0xa750, 0xa750, + 0xa752, 0xa752, + 0xa754, 0xa754, + 0xa756, 0xa756, + 0xa758, 0xa758, + 0xa75a, 0xa75a, + 0xa75c, 0xa75c, + 0xa75e, 0xa75e, + 0xa760, 0xa760, + 0xa762, 0xa762, + 0xa764, 0xa764, + 0xa766, 0xa766, + 0xa768, 0xa768, + 0xa76a, 0xa76a, + 0xa76c, 0xa76c, + 0xa76e, 0xa76e, + 0xa779, 0xa779, + 0xa77b, 0xa77b, + 0xa77d, 0xa77e, + 0xa780, 0xa780, + 0xa782, 0xa782, + 0xa784, 0xa784, + 0xa786, 0xa786, + 0xa78b, 0xa78b, + 0xff21, 0xff3a, + 0x10400, 0x10427, + 0x1d400, 0x1d419, + 0x1d434, 0x1d44d, + 0x1d468, 0x1d481, + 0x1d49c, 0x1d49c, + 0x1d49e, 0x1d49f, + 0x1d4a2, 0x1d4a2, + 0x1d4a5, 0x1d4a6, + 0x1d4a9, 0x1d4ac, + 0x1d4ae, 0x1d4b5, + 0x1d4d0, 0x1d4e9, + 0x1d504, 0x1d505, + 0x1d507, 0x1d50a, + 0x1d50d, 0x1d514, + 0x1d516, 0x1d51c, + 0x1d538, 0x1d539, + 0x1d53b, 0x1d53e, + 0x1d540, 0x1d544, + 0x1d546, 0x1d546, + 0x1d54a, 0x1d550, + 0x1d56c, 0x1d585, + 0x1d5a0, 0x1d5b9, + 0x1d5d4, 0x1d5ed, + 0x1d608, 0x1d621, + 0x1d63c, 0x1d655, + 0x1d670, 0x1d689, + 0x1d6a8, 0x1d6c0, + 0x1d6e2, 0x1d6fa, + 0x1d71c, 0x1d734, + 0x1d756, 0x1d76e, + 0x1d790, 0x1d7a8, + 0x1d7ca, 0x1d7ca, +}; /* CR_Lu */ + +/* 'M': Major Category */ +static const OnigCodePoint CR_M[] = { + 188, + 0x0300, 0x036f, + 0x0483, 0x0489, + 0x0591, 0x05bd, + 0x05bf, 0x05bf, + 0x05c1, 0x05c2, + 0x05c4, 0x05c5, + 0x05c7, 0x05c7, + 0x0610, 0x061a, + 0x064b, 0x065e, + 0x0670, 0x0670, + 0x06d6, 0x06dc, + 0x06de, 0x06e4, + 0x06e7, 0x06e8, + 0x06ea, 0x06ed, + 0x0711, 0x0711, + 0x0730, 0x074a, + 0x07a6, 0x07b0, + 0x07eb, 0x07f3, + 0x0816, 0x0819, + 0x081b, 0x0823, + 0x0825, 0x0827, + 0x0829, 0x082d, + 0x0900, 0x0903, + 0x093c, 0x093c, + 0x093e, 0x094e, + 0x0951, 0x0955, + 0x0962, 0x0963, + 0x0981, 0x0983, + 0x09bc, 0x09bc, + 0x09be, 0x09c4, + 0x09c7, 0x09c8, + 0x09cb, 0x09cd, + 0x09d7, 0x09d7, + 0x09e2, 0x09e3, + 0x0a01, 0x0a03, + 0x0a3c, 0x0a3c, + 0x0a3e, 0x0a42, + 0x0a47, 0x0a48, + 0x0a4b, 0x0a4d, + 0x0a51, 0x0a51, + 0x0a70, 0x0a71, + 0x0a75, 0x0a75, + 0x0a81, 0x0a83, + 0x0abc, 0x0abc, + 0x0abe, 0x0ac5, + 0x0ac7, 0x0ac9, + 0x0acb, 0x0acd, + 0x0ae2, 0x0ae3, + 0x0b01, 0x0b03, + 0x0b3c, 0x0b3c, + 0x0b3e, 0x0b44, + 0x0b47, 0x0b48, + 0x0b4b, 0x0b4d, + 0x0b56, 0x0b57, + 0x0b62, 0x0b63, + 0x0b82, 0x0b82, + 0x0bbe, 0x0bc2, + 0x0bc6, 0x0bc8, + 0x0bca, 0x0bcd, + 0x0bd7, 0x0bd7, + 0x0c01, 0x0c03, + 0x0c3e, 0x0c44, + 0x0c46, 0x0c48, + 0x0c4a, 0x0c4d, + 0x0c55, 0x0c56, + 0x0c62, 0x0c63, + 0x0c82, 0x0c83, + 0x0cbc, 0x0cbc, + 0x0cbe, 0x0cc4, + 0x0cc6, 0x0cc8, + 0x0cca, 0x0ccd, + 0x0cd5, 0x0cd6, + 0x0ce2, 0x0ce3, + 0x0d02, 0x0d03, + 0x0d3e, 0x0d44, + 0x0d46, 0x0d48, + 0x0d4a, 0x0d4d, + 0x0d57, 0x0d57, + 0x0d62, 0x0d63, + 0x0d82, 0x0d83, + 0x0dca, 0x0dca, + 0x0dcf, 0x0dd4, + 0x0dd6, 0x0dd6, + 0x0dd8, 0x0ddf, + 0x0df2, 0x0df3, + 0x0e31, 0x0e31, + 0x0e34, 0x0e3a, + 0x0e47, 0x0e4e, + 0x0eb1, 0x0eb1, + 0x0eb4, 0x0eb9, + 0x0ebb, 0x0ebc, + 0x0ec8, 0x0ecd, + 0x0f18, 0x0f19, + 0x0f35, 0x0f35, + 0x0f37, 0x0f37, + 0x0f39, 0x0f39, + 0x0f3e, 0x0f3f, + 0x0f71, 0x0f84, + 0x0f86, 0x0f87, + 0x0f90, 0x0f97, + 0x0f99, 0x0fbc, + 0x0fc6, 0x0fc6, + 0x102b, 0x103e, + 0x1056, 0x1059, + 0x105e, 0x1060, + 0x1062, 0x1064, + 0x1067, 0x106d, + 0x1071, 0x1074, + 0x1082, 0x108d, + 0x108f, 0x108f, + 0x109a, 0x109d, + 0x135f, 0x135f, + 0x1712, 0x1714, + 0x1732, 0x1734, + 0x1752, 0x1753, + 0x1772, 0x1773, + 0x17b6, 0x17d3, + 0x17dd, 0x17dd, + 0x180b, 0x180d, + 0x18a9, 0x18a9, + 0x1920, 0x192b, + 0x1930, 0x193b, + 0x19b0, 0x19c0, + 0x19c8, 0x19c9, + 0x1a17, 0x1a1b, + 0x1a55, 0x1a5e, + 0x1a60, 0x1a7c, + 0x1a7f, 0x1a7f, + 0x1b00, 0x1b04, + 0x1b34, 0x1b44, + 0x1b6b, 0x1b73, + 0x1b80, 0x1b82, + 0x1ba1, 0x1baa, + 0x1c24, 0x1c37, + 0x1cd0, 0x1cd2, + 0x1cd4, 0x1ce8, + 0x1ced, 0x1ced, + 0x1cf2, 0x1cf2, + 0x1dc0, 0x1de6, + 0x1dfd, 0x1dff, + 0x20d0, 0x20f0, + 0x2cef, 0x2cf1, + 0x2de0, 0x2dff, + 0x302a, 0x302f, + 0x3099, 0x309a, + 0xa66f, 0xa672, + 0xa67c, 0xa67d, + 0xa6f0, 0xa6f1, + 0xa802, 0xa802, + 0xa806, 0xa806, + 0xa80b, 0xa80b, + 0xa823, 0xa827, + 0xa880, 0xa881, + 0xa8b4, 0xa8c4, + 0xa8e0, 0xa8f1, + 0xa926, 0xa92d, + 0xa947, 0xa953, + 0xa980, 0xa983, + 0xa9b3, 0xa9c0, + 0xaa29, 0xaa36, + 0xaa43, 0xaa43, + 0xaa4c, 0xaa4d, + 0xaa7b, 0xaa7b, + 0xaab0, 0xaab0, + 0xaab2, 0xaab4, + 0xaab7, 0xaab8, + 0xaabe, 0xaabf, + 0xaac1, 0xaac1, + 0xabe3, 0xabea, + 0xabec, 0xabed, + 0xfb1e, 0xfb1e, + 0xfe00, 0xfe0f, + 0xfe20, 0xfe26, + 0x101fd, 0x101fd, + 0x10a01, 0x10a03, + 0x10a05, 0x10a06, + 0x10a0c, 0x10a0f, + 0x10a38, 0x10a3a, + 0x10a3f, 0x10a3f, + 0x11080, 0x11082, + 0x110b0, 0x110ba, + 0x1d165, 0x1d169, + 0x1d16d, 0x1d172, + 0x1d17b, 0x1d182, + 0x1d185, 0x1d18b, + 0x1d1aa, 0x1d1ad, + 0x1d242, 0x1d244, + 0xe0100, 0xe01ef, +}; /* CR_M */ + +/* 'Mc': General Category */ +static const OnigCodePoint CR_Mc[] = { + 106, + 0x0903, 0x0903, + 0x093e, 0x0940, + 0x0949, 0x094c, + 0x094e, 0x094e, + 0x0982, 0x0983, + 0x09be, 0x09c0, + 0x09c7, 0x09c8, + 0x09cb, 0x09cc, + 0x09d7, 0x09d7, + 0x0a03, 0x0a03, + 0x0a3e, 0x0a40, + 0x0a83, 0x0a83, + 0x0abe, 0x0ac0, + 0x0ac9, 0x0ac9, + 0x0acb, 0x0acc, + 0x0b02, 0x0b03, + 0x0b3e, 0x0b3e, + 0x0b40, 0x0b40, + 0x0b47, 0x0b48, + 0x0b4b, 0x0b4c, + 0x0b57, 0x0b57, + 0x0bbe, 0x0bbf, + 0x0bc1, 0x0bc2, + 0x0bc6, 0x0bc8, + 0x0bca, 0x0bcc, + 0x0bd7, 0x0bd7, + 0x0c01, 0x0c03, + 0x0c41, 0x0c44, + 0x0c82, 0x0c83, + 0x0cbe, 0x0cbe, + 0x0cc0, 0x0cc4, + 0x0cc7, 0x0cc8, + 0x0cca, 0x0ccb, + 0x0cd5, 0x0cd6, + 0x0d02, 0x0d03, + 0x0d3e, 0x0d40, + 0x0d46, 0x0d48, + 0x0d4a, 0x0d4c, + 0x0d57, 0x0d57, + 0x0d82, 0x0d83, + 0x0dcf, 0x0dd1, + 0x0dd8, 0x0ddf, + 0x0df2, 0x0df3, + 0x0f3e, 0x0f3f, + 0x0f7f, 0x0f7f, + 0x102b, 0x102c, + 0x1031, 0x1031, + 0x1038, 0x1038, + 0x103b, 0x103c, + 0x1056, 0x1057, + 0x1062, 0x1064, + 0x1067, 0x106d, + 0x1083, 0x1084, + 0x1087, 0x108c, + 0x108f, 0x108f, + 0x109a, 0x109c, + 0x17b6, 0x17b6, + 0x17be, 0x17c5, + 0x17c7, 0x17c8, + 0x1923, 0x1926, + 0x1929, 0x192b, + 0x1930, 0x1931, + 0x1933, 0x1938, + 0x19b0, 0x19c0, + 0x19c8, 0x19c9, + 0x1a19, 0x1a1b, + 0x1a55, 0x1a55, + 0x1a57, 0x1a57, + 0x1a61, 0x1a61, + 0x1a63, 0x1a64, + 0x1a6d, 0x1a72, + 0x1b04, 0x1b04, + 0x1b35, 0x1b35, + 0x1b3b, 0x1b3b, + 0x1b3d, 0x1b41, + 0x1b43, 0x1b44, + 0x1b82, 0x1b82, + 0x1ba1, 0x1ba1, + 0x1ba6, 0x1ba7, + 0x1baa, 0x1baa, + 0x1c24, 0x1c2b, + 0x1c34, 0x1c35, + 0x1ce1, 0x1ce1, + 0x1cf2, 0x1cf2, + 0xa823, 0xa824, + 0xa827, 0xa827, + 0xa880, 0xa881, + 0xa8b4, 0xa8c3, + 0xa952, 0xa953, + 0xa983, 0xa983, + 0xa9b4, 0xa9b5, + 0xa9ba, 0xa9bb, + 0xa9bd, 0xa9c0, + 0xaa2f, 0xaa30, + 0xaa33, 0xaa34, + 0xaa4d, 0xaa4d, + 0xaa7b, 0xaa7b, + 0xabe3, 0xabe4, + 0xabe6, 0xabe7, + 0xabe9, 0xabea, + 0xabec, 0xabec, + 0x11082, 0x11082, + 0x110b0, 0x110b2, + 0x110b7, 0x110b8, + 0x1d165, 0x1d166, + 0x1d16d, 0x1d172, +}; /* CR_Mc */ + +/* 'Me': General Category */ +static const OnigCodePoint CR_Me[] = { + 5, + 0x0488, 0x0489, + 0x06de, 0x06de, + 0x20dd, 0x20e0, + 0x20e2, 0x20e4, + 0xa670, 0xa672, +}; /* CR_Me */ + +/* 'Mn': General Category */ +static const OnigCodePoint CR_Mn[] = { + 194, + 0x0300, 0x036f, + 0x0483, 0x0487, + 0x0591, 0x05bd, + 0x05bf, 0x05bf, + 0x05c1, 0x05c2, + 0x05c4, 0x05c5, + 0x05c7, 0x05c7, + 0x0610, 0x061a, + 0x064b, 0x065e, + 0x0670, 0x0670, + 0x06d6, 0x06dc, + 0x06df, 0x06e4, + 0x06e7, 0x06e8, + 0x06ea, 0x06ed, + 0x0711, 0x0711, + 0x0730, 0x074a, + 0x07a6, 0x07b0, + 0x07eb, 0x07f3, + 0x0816, 0x0819, + 0x081b, 0x0823, + 0x0825, 0x0827, + 0x0829, 0x082d, + 0x0900, 0x0902, + 0x093c, 0x093c, + 0x0941, 0x0948, + 0x094d, 0x094d, + 0x0951, 0x0955, + 0x0962, 0x0963, + 0x0981, 0x0981, + 0x09bc, 0x09bc, + 0x09c1, 0x09c4, + 0x09cd, 0x09cd, + 0x09e2, 0x09e3, + 0x0a01, 0x0a02, + 0x0a3c, 0x0a3c, + 0x0a41, 0x0a42, + 0x0a47, 0x0a48, + 0x0a4b, 0x0a4d, + 0x0a51, 0x0a51, + 0x0a70, 0x0a71, + 0x0a75, 0x0a75, + 0x0a81, 0x0a82, + 0x0abc, 0x0abc, + 0x0ac1, 0x0ac5, + 0x0ac7, 0x0ac8, + 0x0acd, 0x0acd, + 0x0ae2, 0x0ae3, + 0x0b01, 0x0b01, + 0x0b3c, 0x0b3c, + 0x0b3f, 0x0b3f, + 0x0b41, 0x0b44, + 0x0b4d, 0x0b4d, + 0x0b56, 0x0b56, + 0x0b62, 0x0b63, + 0x0b82, 0x0b82, + 0x0bc0, 0x0bc0, + 0x0bcd, 0x0bcd, + 0x0c3e, 0x0c40, + 0x0c46, 0x0c48, + 0x0c4a, 0x0c4d, + 0x0c55, 0x0c56, + 0x0c62, 0x0c63, + 0x0cbc, 0x0cbc, + 0x0cbf, 0x0cbf, + 0x0cc6, 0x0cc6, + 0x0ccc, 0x0ccd, + 0x0ce2, 0x0ce3, + 0x0d41, 0x0d44, + 0x0d4d, 0x0d4d, + 0x0d62, 0x0d63, + 0x0dca, 0x0dca, + 0x0dd2, 0x0dd4, + 0x0dd6, 0x0dd6, + 0x0e31, 0x0e31, + 0x0e34, 0x0e3a, + 0x0e47, 0x0e4e, + 0x0eb1, 0x0eb1, + 0x0eb4, 0x0eb9, + 0x0ebb, 0x0ebc, + 0x0ec8, 0x0ecd, + 0x0f18, 0x0f19, + 0x0f35, 0x0f35, + 0x0f37, 0x0f37, + 0x0f39, 0x0f39, + 0x0f71, 0x0f7e, + 0x0f80, 0x0f84, + 0x0f86, 0x0f87, + 0x0f90, 0x0f97, + 0x0f99, 0x0fbc, + 0x0fc6, 0x0fc6, + 0x102d, 0x1030, + 0x1032, 0x1037, + 0x1039, 0x103a, + 0x103d, 0x103e, + 0x1058, 0x1059, + 0x105e, 0x1060, + 0x1071, 0x1074, + 0x1082, 0x1082, + 0x1085, 0x1086, + 0x108d, 0x108d, + 0x109d, 0x109d, + 0x135f, 0x135f, + 0x1712, 0x1714, + 0x1732, 0x1734, + 0x1752, 0x1753, + 0x1772, 0x1773, + 0x17b7, 0x17bd, + 0x17c6, 0x17c6, + 0x17c9, 0x17d3, + 0x17dd, 0x17dd, + 0x180b, 0x180d, + 0x18a9, 0x18a9, + 0x1920, 0x1922, + 0x1927, 0x1928, + 0x1932, 0x1932, + 0x1939, 0x193b, + 0x1a17, 0x1a18, + 0x1a56, 0x1a56, + 0x1a58, 0x1a5e, + 0x1a60, 0x1a60, + 0x1a62, 0x1a62, + 0x1a65, 0x1a6c, + 0x1a73, 0x1a7c, + 0x1a7f, 0x1a7f, + 0x1b00, 0x1b03, + 0x1b34, 0x1b34, + 0x1b36, 0x1b3a, + 0x1b3c, 0x1b3c, + 0x1b42, 0x1b42, + 0x1b6b, 0x1b73, + 0x1b80, 0x1b81, + 0x1ba2, 0x1ba5, + 0x1ba8, 0x1ba9, + 0x1c2c, 0x1c33, + 0x1c36, 0x1c37, + 0x1cd0, 0x1cd2, + 0x1cd4, 0x1ce0, + 0x1ce2, 0x1ce8, + 0x1ced, 0x1ced, + 0x1dc0, 0x1de6, + 0x1dfd, 0x1dff, + 0x20d0, 0x20dc, + 0x20e1, 0x20e1, + 0x20e5, 0x20f0, + 0x2cef, 0x2cf1, + 0x2de0, 0x2dff, + 0x302a, 0x302f, + 0x3099, 0x309a, + 0xa66f, 0xa66f, + 0xa67c, 0xa67d, + 0xa6f0, 0xa6f1, + 0xa802, 0xa802, + 0xa806, 0xa806, + 0xa80b, 0xa80b, + 0xa825, 0xa826, + 0xa8c4, 0xa8c4, + 0xa8e0, 0xa8f1, + 0xa926, 0xa92d, + 0xa947, 0xa951, + 0xa980, 0xa982, + 0xa9b3, 0xa9b3, + 0xa9b6, 0xa9b9, + 0xa9bc, 0xa9bc, + 0xaa29, 0xaa2e, + 0xaa31, 0xaa32, + 0xaa35, 0xaa36, + 0xaa43, 0xaa43, + 0xaa4c, 0xaa4c, + 0xaab0, 0xaab0, + 0xaab2, 0xaab4, + 0xaab7, 0xaab8, + 0xaabe, 0xaabf, + 0xaac1, 0xaac1, + 0xabe5, 0xabe5, + 0xabe8, 0xabe8, + 0xabed, 0xabed, + 0xfb1e, 0xfb1e, + 0xfe00, 0xfe0f, + 0xfe20, 0xfe26, + 0x101fd, 0x101fd, + 0x10a01, 0x10a03, + 0x10a05, 0x10a06, + 0x10a0c, 0x10a0f, + 0x10a38, 0x10a3a, + 0x10a3f, 0x10a3f, + 0x11080, 0x11081, + 0x110b3, 0x110b6, + 0x110b9, 0x110ba, + 0x1d167, 0x1d169, + 0x1d17b, 0x1d182, + 0x1d185, 0x1d18b, + 0x1d1aa, 0x1d1ad, + 0x1d242, 0x1d244, + 0xe0100, 0xe01ef, +}; /* CR_Mn */ + +/* 'N': Major Category */ +static const OnigCodePoint CR_N[] = { + 81, + 0x0030, 0x0039, + 0x00b2, 0x00b3, + 0x00b9, 0x00b9, + 0x00bc, 0x00be, + 0x0660, 0x0669, + 0x06f0, 0x06f9, + 0x07c0, 0x07c9, + 0x0966, 0x096f, + 0x09e6, 0x09ef, + 0x09f4, 0x09f9, + 0x0a66, 0x0a6f, + 0x0ae6, 0x0aef, + 0x0b66, 0x0b6f, + 0x0be6, 0x0bf2, + 0x0c66, 0x0c6f, + 0x0c78, 0x0c7e, + 0x0ce6, 0x0cef, + 0x0d66, 0x0d75, + 0x0e50, 0x0e59, + 0x0ed0, 0x0ed9, + 0x0f20, 0x0f33, + 0x1040, 0x1049, + 0x1090, 0x1099, + 0x1369, 0x137c, + 0x16ee, 0x16f0, + 0x17e0, 0x17e9, + 0x17f0, 0x17f9, + 0x1810, 0x1819, + 0x1946, 0x194f, + 0x19d0, 0x19da, + 0x1a80, 0x1a89, + 0x1a90, 0x1a99, + 0x1b50, 0x1b59, + 0x1bb0, 0x1bb9, + 0x1c40, 0x1c49, + 0x1c50, 0x1c59, + 0x2070, 0x2070, + 0x2074, 0x2079, + 0x2080, 0x2089, + 0x2150, 0x2182, + 0x2185, 0x2189, + 0x2460, 0x249b, + 0x24ea, 0x24ff, + 0x2776, 0x2793, + 0x2cfd, 0x2cfd, + 0x3007, 0x3007, + 0x3021, 0x3029, + 0x3038, 0x303a, + 0x3192, 0x3195, + 0x3220, 0x3229, + 0x3251, 0x325f, + 0x3280, 0x3289, + 0x32b1, 0x32bf, + 0xa620, 0xa629, + 0xa6e6, 0xa6ef, + 0xa830, 0xa835, + 0xa8d0, 0xa8d9, + 0xa900, 0xa909, + 0xa9d0, 0xa9d9, + 0xaa50, 0xaa59, + 0xabf0, 0xabf9, + 0xff10, 0xff19, + 0x10107, 0x10133, + 0x10140, 0x10178, + 0x1018a, 0x1018a, + 0x10320, 0x10323, + 0x10341, 0x10341, + 0x1034a, 0x1034a, + 0x103d1, 0x103d5, + 0x104a0, 0x104a9, + 0x10858, 0x1085f, + 0x10916, 0x1091b, + 0x10a40, 0x10a47, + 0x10a7d, 0x10a7e, + 0x10b58, 0x10b5f, + 0x10b78, 0x10b7f, + 0x10e60, 0x10e7e, + 0x12400, 0x12462, + 0x1d360, 0x1d371, + 0x1d7ce, 0x1d7ff, + 0x1f100, 0x1f10a, +}; /* CR_N */ + +/* 'Nd': General Category */ +static const OnigCodePoint CR_Nd[] = { + 37, + 0x0030, 0x0039, + 0x0660, 0x0669, + 0x06f0, 0x06f9, + 0x07c0, 0x07c9, + 0x0966, 0x096f, + 0x09e6, 0x09ef, + 0x0a66, 0x0a6f, + 0x0ae6, 0x0aef, + 0x0b66, 0x0b6f, + 0x0be6, 0x0bef, + 0x0c66, 0x0c6f, + 0x0ce6, 0x0cef, + 0x0d66, 0x0d6f, + 0x0e50, 0x0e59, + 0x0ed0, 0x0ed9, + 0x0f20, 0x0f29, + 0x1040, 0x1049, + 0x1090, 0x1099, + 0x17e0, 0x17e9, + 0x1810, 0x1819, + 0x1946, 0x194f, + 0x19d0, 0x19da, + 0x1a80, 0x1a89, + 0x1a90, 0x1a99, + 0x1b50, 0x1b59, + 0x1bb0, 0x1bb9, + 0x1c40, 0x1c49, + 0x1c50, 0x1c59, + 0xa620, 0xa629, + 0xa8d0, 0xa8d9, + 0xa900, 0xa909, + 0xa9d0, 0xa9d9, + 0xaa50, 0xaa59, + 0xabf0, 0xabf9, + 0xff10, 0xff19, + 0x104a0, 0x104a9, + 0x1d7ce, 0x1d7ff, +}; /* CR_Nd */ + +/* 'Nl': General Category */ +static const OnigCodePoint CR_Nl[] = { + 12, + 0x16ee, 0x16f0, + 0x2160, 0x2182, + 0x2185, 0x2188, + 0x3007, 0x3007, + 0x3021, 0x3029, + 0x3038, 0x303a, + 0xa6e6, 0xa6ef, + 0x10140, 0x10174, + 0x10341, 0x10341, + 0x1034a, 0x1034a, + 0x103d1, 0x103d5, + 0x12400, 0x12462, +}; /* CR_Nl */ + +/* 'No': General Category */ +static const OnigCodePoint CR_No[] = { + 38, + 0x00b2, 0x00b3, + 0x00b9, 0x00b9, + 0x00bc, 0x00be, + 0x09f4, 0x09f9, + 0x0bf0, 0x0bf2, + 0x0c78, 0x0c7e, + 0x0d70, 0x0d75, + 0x0f2a, 0x0f33, + 0x1369, 0x137c, + 0x17f0, 0x17f9, + 0x2070, 0x2070, + 0x2074, 0x2079, + 0x2080, 0x2089, + 0x2150, 0x215f, + 0x2189, 0x2189, + 0x2460, 0x249b, + 0x24ea, 0x24ff, + 0x2776, 0x2793, + 0x2cfd, 0x2cfd, + 0x3192, 0x3195, + 0x3220, 0x3229, + 0x3251, 0x325f, + 0x3280, 0x3289, + 0x32b1, 0x32bf, + 0xa830, 0xa835, + 0x10107, 0x10133, + 0x10175, 0x10178, + 0x1018a, 0x1018a, + 0x10320, 0x10323, + 0x10858, 0x1085f, + 0x10916, 0x1091b, + 0x10a40, 0x10a47, + 0x10a7d, 0x10a7e, + 0x10b58, 0x10b5f, + 0x10b78, 0x10b7f, + 0x10e60, 0x10e7e, + 0x1d360, 0x1d371, + 0x1f100, 0x1f10a, +}; /* CR_No */ + +/* 'P': Major Category */ +static const OnigCodePoint CR_P[] = { + 129, + 0x0021, 0x0023, + 0x0025, 0x002a, + 0x002c, 0x002f, + 0x003a, 0x003b, + 0x003f, 0x0040, + 0x005b, 0x005d, + 0x005f, 0x005f, + 0x007b, 0x007b, + 0x007d, 0x007d, + 0x00a1, 0x00a1, + 0x00ab, 0x00ab, + 0x00b7, 0x00b7, + 0x00bb, 0x00bb, + 0x00bf, 0x00bf, + 0x037e, 0x037e, + 0x0387, 0x0387, + 0x055a, 0x055f, + 0x0589, 0x058a, + 0x05be, 0x05be, + 0x05c0, 0x05c0, + 0x05c3, 0x05c3, + 0x05c6, 0x05c6, + 0x05f3, 0x05f4, + 0x0609, 0x060a, + 0x060c, 0x060d, + 0x061b, 0x061b, + 0x061e, 0x061f, + 0x066a, 0x066d, + 0x06d4, 0x06d4, + 0x0700, 0x070d, + 0x07f7, 0x07f9, + 0x0830, 0x083e, + 0x0964, 0x0965, + 0x0970, 0x0970, + 0x0df4, 0x0df4, + 0x0e4f, 0x0e4f, + 0x0e5a, 0x0e5b, + 0x0f04, 0x0f12, + 0x0f3a, 0x0f3d, + 0x0f85, 0x0f85, + 0x0fd0, 0x0fd4, + 0x104a, 0x104f, + 0x10fb, 0x10fb, + 0x1361, 0x1368, + 0x1400, 0x1400, + 0x166d, 0x166e, + 0x169b, 0x169c, + 0x16eb, 0x16ed, + 0x1735, 0x1736, + 0x17d4, 0x17d6, + 0x17d8, 0x17da, + 0x1800, 0x180a, + 0x1944, 0x1945, + 0x19de, 0x19df, + 0x1a1e, 0x1a1f, + 0x1aa0, 0x1aa6, + 0x1aa8, 0x1aad, + 0x1b5a, 0x1b60, + 0x1c3b, 0x1c3f, + 0x1c7e, 0x1c7f, + 0x1cd3, 0x1cd3, + 0x2010, 0x2027, + 0x2030, 0x2043, + 0x2045, 0x2051, + 0x2053, 0x205e, + 0x207d, 0x207e, + 0x208d, 0x208e, + 0x2329, 0x232a, + 0x2768, 0x2775, + 0x27c5, 0x27c6, + 0x27e6, 0x27ef, + 0x2983, 0x2998, + 0x29d8, 0x29db, + 0x29fc, 0x29fd, + 0x2cf9, 0x2cfc, + 0x2cfe, 0x2cff, + 0x2e00, 0x2e2e, + 0x2e30, 0x2e31, + 0x3001, 0x3003, + 0x3008, 0x3011, + 0x3014, 0x301f, + 0x3030, 0x3030, + 0x303d, 0x303d, + 0x30a0, 0x30a0, + 0x30fb, 0x30fb, + 0xa4fe, 0xa4ff, + 0xa60d, 0xa60f, + 0xa673, 0xa673, + 0xa67e, 0xa67e, + 0xa6f2, 0xa6f7, + 0xa874, 0xa877, + 0xa8ce, 0xa8cf, + 0xa8f8, 0xa8fa, + 0xa92e, 0xa92f, + 0xa95f, 0xa95f, + 0xa9c1, 0xa9cd, + 0xa9de, 0xa9df, + 0xaa5c, 0xaa5f, + 0xaade, 0xaadf, + 0xabeb, 0xabeb, + 0xfd3e, 0xfd3f, + 0xfe10, 0xfe19, + 0xfe30, 0xfe52, + 0xfe54, 0xfe61, + 0xfe63, 0xfe63, + 0xfe68, 0xfe68, + 0xfe6a, 0xfe6b, + 0xff01, 0xff03, + 0xff05, 0xff0a, + 0xff0c, 0xff0f, + 0xff1a, 0xff1b, + 0xff1f, 0xff20, + 0xff3b, 0xff3d, + 0xff3f, 0xff3f, + 0xff5b, 0xff5b, + 0xff5d, 0xff5d, + 0xff5f, 0xff65, + 0x10100, 0x10101, + 0x1039f, 0x1039f, + 0x103d0, 0x103d0, + 0x10857, 0x10857, + 0x1091f, 0x1091f, + 0x1093f, 0x1093f, + 0x10a50, 0x10a58, + 0x10a7f, 0x10a7f, + 0x10b39, 0x10b3f, + 0x110bb, 0x110bc, + 0x110be, 0x110c1, + 0x12470, 0x12473, +}; /* CR_P */ + +/* 'Pc': General Category */ +static const OnigCodePoint CR_Pc[] = { + 6, + 0x005f, 0x005f, + 0x203f, 0x2040, + 0x2054, 0x2054, + 0xfe33, 0xfe34, + 0xfe4d, 0xfe4f, + 0xff3f, 0xff3f, +}; /* CR_Pc */ + +/* 'Pd': General Category */ +static const OnigCodePoint CR_Pd[] = { + 15, + 0x002d, 0x002d, + 0x058a, 0x058a, + 0x05be, 0x05be, + 0x1400, 0x1400, + 0x1806, 0x1806, + 0x2010, 0x2015, + 0x2e17, 0x2e17, + 0x2e1a, 0x2e1a, + 0x301c, 0x301c, + 0x3030, 0x3030, + 0x30a0, 0x30a0, + 0xfe31, 0xfe32, + 0xfe58, 0xfe58, + 0xfe63, 0xfe63, + 0xff0d, 0xff0d, +}; /* CR_Pd */ + +/* 'Pe': General Category */ +static const OnigCodePoint CR_Pe[] = { + 70, + 0x0029, 0x0029, + 0x005d, 0x005d, + 0x007d, 0x007d, + 0x0f3b, 0x0f3b, + 0x0f3d, 0x0f3d, + 0x169c, 0x169c, + 0x2046, 0x2046, + 0x207e, 0x207e, + 0x208e, 0x208e, + 0x232a, 0x232a, + 0x2769, 0x2769, + 0x276b, 0x276b, + 0x276d, 0x276d, + 0x276f, 0x276f, + 0x2771, 0x2771, + 0x2773, 0x2773, + 0x2775, 0x2775, + 0x27c6, 0x27c6, + 0x27e7, 0x27e7, + 0x27e9, 0x27e9, + 0x27eb, 0x27eb, + 0x27ed, 0x27ed, + 0x27ef, 0x27ef, + 0x2984, 0x2984, + 0x2986, 0x2986, + 0x2988, 0x2988, + 0x298a, 0x298a, + 0x298c, 0x298c, + 0x298e, 0x298e, + 0x2990, 0x2990, + 0x2992, 0x2992, + 0x2994, 0x2994, + 0x2996, 0x2996, + 0x2998, 0x2998, + 0x29d9, 0x29d9, + 0x29db, 0x29db, + 0x29fd, 0x29fd, + 0x2e23, 0x2e23, + 0x2e25, 0x2e25, + 0x2e27, 0x2e27, + 0x2e29, 0x2e29, + 0x3009, 0x3009, + 0x300b, 0x300b, + 0x300d, 0x300d, + 0x300f, 0x300f, + 0x3011, 0x3011, + 0x3015, 0x3015, + 0x3017, 0x3017, + 0x3019, 0x3019, + 0x301b, 0x301b, + 0x301e, 0x301f, + 0xfd3f, 0xfd3f, + 0xfe18, 0xfe18, + 0xfe36, 0xfe36, + 0xfe38, 0xfe38, + 0xfe3a, 0xfe3a, + 0xfe3c, 0xfe3c, + 0xfe3e, 0xfe3e, + 0xfe40, 0xfe40, + 0xfe42, 0xfe42, + 0xfe44, 0xfe44, + 0xfe48, 0xfe48, + 0xfe5a, 0xfe5a, + 0xfe5c, 0xfe5c, + 0xfe5e, 0xfe5e, + 0xff09, 0xff09, + 0xff3d, 0xff3d, + 0xff5d, 0xff5d, + 0xff60, 0xff60, + 0xff63, 0xff63, +}; /* CR_Pe */ + +/* 'Pf': General Category */ +static const OnigCodePoint CR_Pf[] = { + 10, + 0x00bb, 0x00bb, + 0x2019, 0x2019, + 0x201d, 0x201d, + 0x203a, 0x203a, + 0x2e03, 0x2e03, + 0x2e05, 0x2e05, + 0x2e0a, 0x2e0a, + 0x2e0d, 0x2e0d, + 0x2e1d, 0x2e1d, + 0x2e21, 0x2e21, +}; /* CR_Pf */ + +/* 'Pi': General Category */ +static const OnigCodePoint CR_Pi[] = { + 11, + 0x00ab, 0x00ab, + 0x2018, 0x2018, + 0x201b, 0x201c, + 0x201f, 0x201f, + 0x2039, 0x2039, + 0x2e02, 0x2e02, + 0x2e04, 0x2e04, + 0x2e09, 0x2e09, + 0x2e0c, 0x2e0c, + 0x2e1c, 0x2e1c, + 0x2e20, 0x2e20, +}; /* CR_Pi */ + +/* 'Po': General Category */ +static const OnigCodePoint CR_Po[] = { + 124, + 0x0021, 0x0023, + 0x0025, 0x0027, + 0x002a, 0x002a, + 0x002c, 0x002c, + 0x002e, 0x002f, + 0x003a, 0x003b, + 0x003f, 0x0040, + 0x005c, 0x005c, + 0x00a1, 0x00a1, + 0x00b7, 0x00b7, + 0x00bf, 0x00bf, + 0x037e, 0x037e, + 0x0387, 0x0387, + 0x055a, 0x055f, + 0x0589, 0x0589, + 0x05c0, 0x05c0, + 0x05c3, 0x05c3, + 0x05c6, 0x05c6, + 0x05f3, 0x05f4, + 0x0609, 0x060a, + 0x060c, 0x060d, + 0x061b, 0x061b, + 0x061e, 0x061f, + 0x066a, 0x066d, + 0x06d4, 0x06d4, + 0x0700, 0x070d, + 0x07f7, 0x07f9, + 0x0830, 0x083e, + 0x0964, 0x0965, + 0x0970, 0x0970, + 0x0df4, 0x0df4, + 0x0e4f, 0x0e4f, + 0x0e5a, 0x0e5b, + 0x0f04, 0x0f12, + 0x0f85, 0x0f85, + 0x0fd0, 0x0fd4, + 0x104a, 0x104f, + 0x10fb, 0x10fb, + 0x1361, 0x1368, + 0x166d, 0x166e, + 0x16eb, 0x16ed, + 0x1735, 0x1736, + 0x17d4, 0x17d6, + 0x17d8, 0x17da, + 0x1800, 0x1805, + 0x1807, 0x180a, + 0x1944, 0x1945, + 0x19de, 0x19df, + 0x1a1e, 0x1a1f, + 0x1aa0, 0x1aa6, + 0x1aa8, 0x1aad, + 0x1b5a, 0x1b60, + 0x1c3b, 0x1c3f, + 0x1c7e, 0x1c7f, + 0x1cd3, 0x1cd3, + 0x2016, 0x2017, + 0x2020, 0x2027, + 0x2030, 0x2038, + 0x203b, 0x203e, + 0x2041, 0x2043, + 0x2047, 0x2051, + 0x2053, 0x2053, + 0x2055, 0x205e, + 0x2cf9, 0x2cfc, + 0x2cfe, 0x2cff, + 0x2e00, 0x2e01, + 0x2e06, 0x2e08, + 0x2e0b, 0x2e0b, + 0x2e0e, 0x2e16, + 0x2e18, 0x2e19, + 0x2e1b, 0x2e1b, + 0x2e1e, 0x2e1f, + 0x2e2a, 0x2e2e, + 0x2e30, 0x2e31, + 0x3001, 0x3003, + 0x303d, 0x303d, + 0x30fb, 0x30fb, + 0xa4fe, 0xa4ff, + 0xa60d, 0xa60f, + 0xa673, 0xa673, + 0xa67e, 0xa67e, + 0xa6f2, 0xa6f7, + 0xa874, 0xa877, + 0xa8ce, 0xa8cf, + 0xa8f8, 0xa8fa, + 0xa92e, 0xa92f, + 0xa95f, 0xa95f, + 0xa9c1, 0xa9cd, + 0xa9de, 0xa9df, + 0xaa5c, 0xaa5f, + 0xaade, 0xaadf, + 0xabeb, 0xabeb, + 0xfe10, 0xfe16, + 0xfe19, 0xfe19, + 0xfe30, 0xfe30, + 0xfe45, 0xfe46, + 0xfe49, 0xfe4c, + 0xfe50, 0xfe52, + 0xfe54, 0xfe57, + 0xfe5f, 0xfe61, + 0xfe68, 0xfe68, + 0xfe6a, 0xfe6b, + 0xff01, 0xff03, + 0xff05, 0xff07, + 0xff0a, 0xff0a, + 0xff0c, 0xff0c, + 0xff0e, 0xff0f, + 0xff1a, 0xff1b, + 0xff1f, 0xff20, + 0xff3c, 0xff3c, + 0xff61, 0xff61, + 0xff64, 0xff65, + 0x10100, 0x10101, + 0x1039f, 0x1039f, + 0x103d0, 0x103d0, + 0x10857, 0x10857, + 0x1091f, 0x1091f, + 0x1093f, 0x1093f, + 0x10a50, 0x10a58, + 0x10a7f, 0x10a7f, + 0x10b39, 0x10b3f, + 0x110bb, 0x110bc, + 0x110be, 0x110c1, + 0x12470, 0x12473, +}; /* CR_Po */ + +/* 'Ps': General Category */ +static const OnigCodePoint CR_Ps[] = { + 72, + 0x0028, 0x0028, + 0x005b, 0x005b, + 0x007b, 0x007b, + 0x0f3a, 0x0f3a, + 0x0f3c, 0x0f3c, + 0x169b, 0x169b, + 0x201a, 0x201a, + 0x201e, 0x201e, + 0x2045, 0x2045, + 0x207d, 0x207d, + 0x208d, 0x208d, + 0x2329, 0x2329, + 0x2768, 0x2768, + 0x276a, 0x276a, + 0x276c, 0x276c, + 0x276e, 0x276e, + 0x2770, 0x2770, + 0x2772, 0x2772, + 0x2774, 0x2774, + 0x27c5, 0x27c5, + 0x27e6, 0x27e6, + 0x27e8, 0x27e8, + 0x27ea, 0x27ea, + 0x27ec, 0x27ec, + 0x27ee, 0x27ee, + 0x2983, 0x2983, + 0x2985, 0x2985, + 0x2987, 0x2987, + 0x2989, 0x2989, + 0x298b, 0x298b, + 0x298d, 0x298d, + 0x298f, 0x298f, + 0x2991, 0x2991, + 0x2993, 0x2993, + 0x2995, 0x2995, + 0x2997, 0x2997, + 0x29d8, 0x29d8, + 0x29da, 0x29da, + 0x29fc, 0x29fc, + 0x2e22, 0x2e22, + 0x2e24, 0x2e24, + 0x2e26, 0x2e26, + 0x2e28, 0x2e28, + 0x3008, 0x3008, + 0x300a, 0x300a, + 0x300c, 0x300c, + 0x300e, 0x300e, + 0x3010, 0x3010, + 0x3014, 0x3014, + 0x3016, 0x3016, + 0x3018, 0x3018, + 0x301a, 0x301a, + 0x301d, 0x301d, + 0xfd3e, 0xfd3e, + 0xfe17, 0xfe17, + 0xfe35, 0xfe35, + 0xfe37, 0xfe37, + 0xfe39, 0xfe39, + 0xfe3b, 0xfe3b, + 0xfe3d, 0xfe3d, + 0xfe3f, 0xfe3f, + 0xfe41, 0xfe41, + 0xfe43, 0xfe43, + 0xfe47, 0xfe47, + 0xfe59, 0xfe59, + 0xfe5b, 0xfe5b, + 0xfe5d, 0xfe5d, + 0xff08, 0xff08, + 0xff3b, 0xff3b, + 0xff5b, 0xff5b, + 0xff5f, 0xff5f, + 0xff62, 0xff62, +}; /* CR_Ps */ + +/* 'S': Major Category */ +static const OnigCodePoint CR_S[] = { + 198, + 0x0024, 0x0024, + 0x002b, 0x002b, + 0x003c, 0x003e, + 0x005e, 0x005e, + 0x0060, 0x0060, + 0x007c, 0x007c, + 0x007e, 0x007e, + 0x00a2, 0x00a9, + 0x00ac, 0x00ac, + 0x00ae, 0x00b1, + 0x00b4, 0x00b4, + 0x00b6, 0x00b6, + 0x00b8, 0x00b8, + 0x00d7, 0x00d7, + 0x00f7, 0x00f7, + 0x02c2, 0x02c5, + 0x02d2, 0x02df, + 0x02e5, 0x02eb, + 0x02ed, 0x02ed, + 0x02ef, 0x02ff, + 0x0375, 0x0375, + 0x0384, 0x0385, + 0x03f6, 0x03f6, + 0x0482, 0x0482, + 0x0606, 0x0608, + 0x060b, 0x060b, + 0x060e, 0x060f, + 0x06e9, 0x06e9, + 0x06fd, 0x06fe, + 0x07f6, 0x07f6, + 0x09f2, 0x09f3, + 0x09fa, 0x09fb, + 0x0af1, 0x0af1, + 0x0b70, 0x0b70, + 0x0bf3, 0x0bfa, + 0x0c7f, 0x0c7f, + 0x0cf1, 0x0cf2, + 0x0d79, 0x0d79, + 0x0e3f, 0x0e3f, + 0x0f01, 0x0f03, + 0x0f13, 0x0f17, + 0x0f1a, 0x0f1f, + 0x0f34, 0x0f34, + 0x0f36, 0x0f36, + 0x0f38, 0x0f38, + 0x0fbe, 0x0fc5, + 0x0fc7, 0x0fcc, + 0x0fce, 0x0fcf, + 0x0fd5, 0x0fd8, + 0x109e, 0x109f, + 0x1360, 0x1360, + 0x1390, 0x1399, + 0x17db, 0x17db, + 0x1940, 0x1940, + 0x19e0, 0x19ff, + 0x1b61, 0x1b6a, + 0x1b74, 0x1b7c, + 0x1fbd, 0x1fbd, + 0x1fbf, 0x1fc1, + 0x1fcd, 0x1fcf, + 0x1fdd, 0x1fdf, + 0x1fed, 0x1fef, + 0x1ffd, 0x1ffe, + 0x2044, 0x2044, + 0x2052, 0x2052, + 0x207a, 0x207c, + 0x208a, 0x208c, + 0x20a0, 0x20b8, + 0x2100, 0x2101, + 0x2103, 0x2106, + 0x2108, 0x2109, + 0x2114, 0x2114, + 0x2116, 0x2118, + 0x211e, 0x2123, + 0x2125, 0x2125, + 0x2127, 0x2127, + 0x2129, 0x2129, + 0x212e, 0x212e, + 0x213a, 0x213b, + 0x2140, 0x2144, + 0x214a, 0x214d, + 0x214f, 0x214f, + 0x2190, 0x2328, + 0x232b, 0x23e8, + 0x2400, 0x2426, + 0x2440, 0x244a, + 0x249c, 0x24e9, + 0x2500, 0x26cd, + 0x26cf, 0x26e1, + 0x26e3, 0x26e3, + 0x26e8, 0x26ff, + 0x2701, 0x2704, + 0x2706, 0x2709, + 0x270c, 0x2727, + 0x2729, 0x274b, + 0x274d, 0x274d, + 0x274f, 0x2752, + 0x2756, 0x275e, + 0x2761, 0x2767, + 0x2794, 0x2794, + 0x2798, 0x27af, + 0x27b1, 0x27be, + 0x27c0, 0x27c4, + 0x27c7, 0x27ca, + 0x27cc, 0x27cc, + 0x27d0, 0x27e5, + 0x27f0, 0x2982, + 0x2999, 0x29d7, + 0x29dc, 0x29fb, + 0x29fe, 0x2b4c, + 0x2b50, 0x2b59, + 0x2ce5, 0x2cea, + 0x2e80, 0x2e99, + 0x2e9b, 0x2ef3, + 0x2f00, 0x2fd5, + 0x2ff0, 0x2ffb, + 0x3004, 0x3004, + 0x3012, 0x3013, + 0x3020, 0x3020, + 0x3036, 0x3037, + 0x303e, 0x303f, + 0x309b, 0x309c, + 0x3190, 0x3191, + 0x3196, 0x319f, + 0x31c0, 0x31e3, + 0x3200, 0x321e, + 0x322a, 0x3250, + 0x3260, 0x327f, + 0x328a, 0x32b0, + 0x32c0, 0x32fe, + 0x3300, 0x33ff, + 0x4dc0, 0x4dff, + 0xa490, 0xa4c6, + 0xa700, 0xa716, + 0xa720, 0xa721, + 0xa789, 0xa78a, + 0xa828, 0xa82b, + 0xa836, 0xa839, + 0xaa77, 0xaa79, + 0xfb29, 0xfb29, + 0xfdfc, 0xfdfd, + 0xfe62, 0xfe62, + 0xfe64, 0xfe66, + 0xfe69, 0xfe69, + 0xff04, 0xff04, + 0xff0b, 0xff0b, + 0xff1c, 0xff1e, + 0xff3e, 0xff3e, + 0xff40, 0xff40, + 0xff5c, 0xff5c, + 0xff5e, 0xff5e, + 0xffe0, 0xffe6, + 0xffe8, 0xffee, + 0xfffc, 0xfffd, + 0x10102, 0x10102, + 0x10137, 0x1013f, + 0x10179, 0x10189, + 0x10190, 0x1019b, + 0x101d0, 0x101fc, + 0x1d000, 0x1d0f5, + 0x1d100, 0x1d126, + 0x1d129, 0x1d164, + 0x1d16a, 0x1d16c, + 0x1d183, 0x1d184, + 0x1d18c, 0x1d1a9, + 0x1d1ae, 0x1d1dd, + 0x1d200, 0x1d241, + 0x1d245, 0x1d245, + 0x1d300, 0x1d356, + 0x1d6c1, 0x1d6c1, + 0x1d6db, 0x1d6db, + 0x1d6fb, 0x1d6fb, + 0x1d715, 0x1d715, + 0x1d735, 0x1d735, + 0x1d74f, 0x1d74f, + 0x1d76f, 0x1d76f, + 0x1d789, 0x1d789, + 0x1d7a9, 0x1d7a9, + 0x1d7c3, 0x1d7c3, + 0x1f000, 0x1f02b, + 0x1f030, 0x1f093, + 0x1f110, 0x1f12e, + 0x1f131, 0x1f131, + 0x1f13d, 0x1f13d, + 0x1f13f, 0x1f13f, + 0x1f142, 0x1f142, + 0x1f146, 0x1f146, + 0x1f14a, 0x1f14e, + 0x1f157, 0x1f157, + 0x1f15f, 0x1f15f, + 0x1f179, 0x1f179, + 0x1f17b, 0x1f17c, + 0x1f17f, 0x1f17f, + 0x1f18a, 0x1f18d, + 0x1f190, 0x1f190, + 0x1f200, 0x1f200, + 0x1f210, 0x1f231, + 0x1f240, 0x1f248, +}; /* CR_S */ + +/* 'Sc': General Category */ +static const OnigCodePoint CR_Sc[] = { + 16, + 0x0024, 0x0024, + 0x00a2, 0x00a5, + 0x060b, 0x060b, + 0x09f2, 0x09f3, + 0x09fb, 0x09fb, + 0x0af1, 0x0af1, + 0x0bf9, 0x0bf9, + 0x0e3f, 0x0e3f, + 0x17db, 0x17db, + 0x20a0, 0x20b8, + 0xa838, 0xa838, + 0xfdfc, 0xfdfc, + 0xfe69, 0xfe69, + 0xff04, 0xff04, + 0xffe0, 0xffe1, + 0xffe5, 0xffe6, +}; /* CR_Sc */ + +/* 'Sk': General Category */ +static const OnigCodePoint CR_Sk[] = { + 26, + 0x005e, 0x005e, + 0x0060, 0x0060, + 0x00a8, 0x00a8, + 0x00af, 0x00af, + 0x00b4, 0x00b4, + 0x00b8, 0x00b8, + 0x02c2, 0x02c5, + 0x02d2, 0x02df, + 0x02e5, 0x02eb, + 0x02ed, 0x02ed, + 0x02ef, 0x02ff, + 0x0375, 0x0375, + 0x0384, 0x0385, + 0x1fbd, 0x1fbd, + 0x1fbf, 0x1fc1, + 0x1fcd, 0x1fcf, + 0x1fdd, 0x1fdf, + 0x1fed, 0x1fef, + 0x1ffd, 0x1ffe, + 0x309b, 0x309c, + 0xa700, 0xa716, + 0xa720, 0xa721, + 0xa789, 0xa78a, + 0xff3e, 0xff3e, + 0xff40, 0xff40, + 0xffe3, 0xffe3, +}; /* CR_Sk */ + +/* 'Sm': General Category */ +static const OnigCodePoint CR_Sm[] = { + 65, + 0x002b, 0x002b, + 0x003c, 0x003e, + 0x007c, 0x007c, + 0x007e, 0x007e, + 0x00ac, 0x00ac, + 0x00b1, 0x00b1, + 0x00d7, 0x00d7, + 0x00f7, 0x00f7, + 0x03f6, 0x03f6, + 0x0606, 0x0608, + 0x2044, 0x2044, + 0x2052, 0x2052, + 0x207a, 0x207c, + 0x208a, 0x208c, + 0x2140, 0x2144, + 0x214b, 0x214b, + 0x2190, 0x2194, + 0x219a, 0x219b, + 0x21a0, 0x21a0, + 0x21a3, 0x21a3, + 0x21a6, 0x21a6, + 0x21ae, 0x21ae, + 0x21ce, 0x21cf, + 0x21d2, 0x21d2, + 0x21d4, 0x21d4, + 0x21f4, 0x22ff, + 0x2308, 0x230b, + 0x2320, 0x2321, + 0x237c, 0x237c, + 0x239b, 0x23b3, + 0x23dc, 0x23e1, + 0x25b7, 0x25b7, + 0x25c1, 0x25c1, + 0x25f8, 0x25ff, + 0x266f, 0x266f, + 0x27c0, 0x27c4, + 0x27c7, 0x27ca, + 0x27cc, 0x27cc, + 0x27d0, 0x27e5, + 0x27f0, 0x27ff, + 0x2900, 0x2982, + 0x2999, 0x29d7, + 0x29dc, 0x29fb, + 0x29fe, 0x2aff, + 0x2b30, 0x2b44, + 0x2b47, 0x2b4c, + 0xfb29, 0xfb29, + 0xfe62, 0xfe62, + 0xfe64, 0xfe66, + 0xff0b, 0xff0b, + 0xff1c, 0xff1e, + 0xff5c, 0xff5c, + 0xff5e, 0xff5e, + 0xffe2, 0xffe2, + 0xffe9, 0xffec, + 0x1d6c1, 0x1d6c1, + 0x1d6db, 0x1d6db, + 0x1d6fb, 0x1d6fb, + 0x1d715, 0x1d715, + 0x1d735, 0x1d735, + 0x1d74f, 0x1d74f, + 0x1d76f, 0x1d76f, + 0x1d789, 0x1d789, + 0x1d7a9, 0x1d7a9, + 0x1d7c3, 0x1d7c3, +}; /* CR_Sm */ + +/* 'So': General Category */ +static const OnigCodePoint CR_So[] = { + 154, + 0x00a6, 0x00a7, + 0x00a9, 0x00a9, + 0x00ae, 0x00ae, + 0x00b0, 0x00b0, + 0x00b6, 0x00b6, + 0x0482, 0x0482, + 0x060e, 0x060f, + 0x06e9, 0x06e9, + 0x06fd, 0x06fe, + 0x07f6, 0x07f6, + 0x09fa, 0x09fa, + 0x0b70, 0x0b70, + 0x0bf3, 0x0bf8, + 0x0bfa, 0x0bfa, + 0x0c7f, 0x0c7f, + 0x0cf1, 0x0cf2, + 0x0d79, 0x0d79, + 0x0f01, 0x0f03, + 0x0f13, 0x0f17, + 0x0f1a, 0x0f1f, + 0x0f34, 0x0f34, + 0x0f36, 0x0f36, + 0x0f38, 0x0f38, + 0x0fbe, 0x0fc5, + 0x0fc7, 0x0fcc, + 0x0fce, 0x0fcf, + 0x0fd5, 0x0fd8, + 0x109e, 0x109f, + 0x1360, 0x1360, + 0x1390, 0x1399, + 0x1940, 0x1940, + 0x19e0, 0x19ff, + 0x1b61, 0x1b6a, + 0x1b74, 0x1b7c, + 0x2100, 0x2101, + 0x2103, 0x2106, + 0x2108, 0x2109, + 0x2114, 0x2114, + 0x2116, 0x2118, + 0x211e, 0x2123, + 0x2125, 0x2125, + 0x2127, 0x2127, + 0x2129, 0x2129, + 0x212e, 0x212e, + 0x213a, 0x213b, + 0x214a, 0x214a, + 0x214c, 0x214d, + 0x214f, 0x214f, + 0x2195, 0x2199, + 0x219c, 0x219f, + 0x21a1, 0x21a2, + 0x21a4, 0x21a5, + 0x21a7, 0x21ad, + 0x21af, 0x21cd, + 0x21d0, 0x21d1, + 0x21d3, 0x21d3, + 0x21d5, 0x21f3, + 0x2300, 0x2307, + 0x230c, 0x231f, + 0x2322, 0x2328, + 0x232b, 0x237b, + 0x237d, 0x239a, + 0x23b4, 0x23db, + 0x23e2, 0x23e8, + 0x2400, 0x2426, + 0x2440, 0x244a, + 0x249c, 0x24e9, + 0x2500, 0x25b6, + 0x25b8, 0x25c0, + 0x25c2, 0x25f7, + 0x2600, 0x266e, + 0x2670, 0x26cd, + 0x26cf, 0x26e1, + 0x26e3, 0x26e3, + 0x26e8, 0x26ff, + 0x2701, 0x2704, + 0x2706, 0x2709, + 0x270c, 0x2727, + 0x2729, 0x274b, + 0x274d, 0x274d, + 0x274f, 0x2752, + 0x2756, 0x275e, + 0x2761, 0x2767, + 0x2794, 0x2794, + 0x2798, 0x27af, + 0x27b1, 0x27be, + 0x2800, 0x28ff, + 0x2b00, 0x2b2f, + 0x2b45, 0x2b46, + 0x2b50, 0x2b59, + 0x2ce5, 0x2cea, + 0x2e80, 0x2e99, + 0x2e9b, 0x2ef3, + 0x2f00, 0x2fd5, + 0x2ff0, 0x2ffb, + 0x3004, 0x3004, + 0x3012, 0x3013, + 0x3020, 0x3020, + 0x3036, 0x3037, + 0x303e, 0x303f, + 0x3190, 0x3191, + 0x3196, 0x319f, + 0x31c0, 0x31e3, + 0x3200, 0x321e, + 0x322a, 0x3250, + 0x3260, 0x327f, + 0x328a, 0x32b0, + 0x32c0, 0x32fe, + 0x3300, 0x33ff, + 0x4dc0, 0x4dff, + 0xa490, 0xa4c6, + 0xa828, 0xa82b, + 0xa836, 0xa837, + 0xa839, 0xa839, + 0xaa77, 0xaa79, + 0xfdfd, 0xfdfd, + 0xffe4, 0xffe4, + 0xffe8, 0xffe8, + 0xffed, 0xffee, + 0xfffc, 0xfffd, + 0x10102, 0x10102, + 0x10137, 0x1013f, + 0x10179, 0x10189, + 0x10190, 0x1019b, + 0x101d0, 0x101fc, + 0x1d000, 0x1d0f5, + 0x1d100, 0x1d126, + 0x1d129, 0x1d164, + 0x1d16a, 0x1d16c, + 0x1d183, 0x1d184, + 0x1d18c, 0x1d1a9, + 0x1d1ae, 0x1d1dd, + 0x1d200, 0x1d241, + 0x1d245, 0x1d245, + 0x1d300, 0x1d356, + 0x1f000, 0x1f02b, + 0x1f030, 0x1f093, + 0x1f110, 0x1f12e, + 0x1f131, 0x1f131, + 0x1f13d, 0x1f13d, + 0x1f13f, 0x1f13f, + 0x1f142, 0x1f142, + 0x1f146, 0x1f146, + 0x1f14a, 0x1f14e, + 0x1f157, 0x1f157, + 0x1f15f, 0x1f15f, + 0x1f179, 0x1f179, + 0x1f17b, 0x1f17c, + 0x1f17f, 0x1f17f, + 0x1f18a, 0x1f18d, + 0x1f190, 0x1f190, + 0x1f200, 0x1f200, + 0x1f210, 0x1f231, + 0x1f240, 0x1f248, +}; /* CR_So */ + +/* 'Z': Major Category */ +static const OnigCodePoint CR_Z[] = { + 9, + 0x0020, 0x0020, + 0x00a0, 0x00a0, + 0x1680, 0x1680, + 0x180e, 0x180e, + 0x2000, 0x200a, + 0x2028, 0x2029, + 0x202f, 0x202f, + 0x205f, 0x205f, + 0x3000, 0x3000, +}; /* CR_Z */ + +/* 'Zl': General Category */ +static const OnigCodePoint CR_Zl[] = { + 1, + 0x2028, 0x2028, +}; /* CR_Zl */ + +/* 'Zp': General Category */ +static const OnigCodePoint CR_Zp[] = { + 1, + 0x2029, 0x2029, +}; /* CR_Zp */ + +/* 'Zs': General Category */ +static const OnigCodePoint CR_Zs[] = { + 8, + 0x0020, 0x0020, + 0x00a0, 0x00a0, + 0x1680, 0x1680, + 0x180e, 0x180e, + 0x2000, 0x200a, + 0x202f, 0x202f, + 0x205f, 0x205f, + 0x3000, 0x3000, +}; /* CR_Zs */ + +/* 'Math': Derived Property */ +static const OnigCodePoint CR_Math[] = { + 105, + 0x002b, 0x002b, + 0x003c, 0x003e, + 0x005e, 0x005e, + 0x007c, 0x007c, + 0x007e, 0x007e, + 0x00ac, 0x00ac, + 0x00b1, 0x00b1, + 0x00d7, 0x00d7, + 0x00f7, 0x00f7, + 0x03d0, 0x03d2, + 0x03d5, 0x03d5, + 0x03f0, 0x03f1, + 0x03f4, 0x03f6, + 0x0606, 0x0608, + 0x2016, 0x2016, + 0x2032, 0x2034, + 0x2040, 0x2040, + 0x2044, 0x2044, + 0x2052, 0x2052, + 0x2061, 0x2064, + 0x207a, 0x207e, + 0x208a, 0x208e, + 0x20d0, 0x20dc, + 0x20e1, 0x20e1, + 0x20e5, 0x20e6, + 0x20eb, 0x20ef, + 0x2102, 0x2102, + 0x210a, 0x2113, + 0x2115, 0x2115, + 0x2119, 0x211d, + 0x2124, 0x2124, + 0x2128, 0x2129, + 0x212c, 0x212d, + 0x212f, 0x2131, + 0x2133, 0x2138, + 0x213c, 0x2149, + 0x214b, 0x214b, + 0x2190, 0x21a7, + 0x21a9, 0x21ae, + 0x21b0, 0x21b1, + 0x21b6, 0x21b7, + 0x21bc, 0x21db, + 0x21dd, 0x21dd, + 0x21e4, 0x21e5, + 0x21f4, 0x22ff, + 0x2308, 0x230b, + 0x2320, 0x2321, + 0x237c, 0x237c, + 0x239b, 0x23b5, + 0x23b7, 0x23b7, + 0x23d0, 0x23d0, + 0x23dc, 0x23e2, + 0x25a0, 0x25a1, + 0x25ae, 0x25b7, + 0x25bc, 0x25c1, + 0x25c6, 0x25c7, + 0x25ca, 0x25cb, + 0x25cf, 0x25d3, + 0x25e2, 0x25e2, + 0x25e4, 0x25e4, + 0x25e7, 0x25ec, + 0x25f8, 0x25ff, + 0x2605, 0x2606, + 0x2640, 0x2640, + 0x2642, 0x2642, + 0x2660, 0x2663, + 0x266d, 0x266f, + 0x27c0, 0x27ca, + 0x27cc, 0x27cc, + 0x27d0, 0x27ff, + 0x2900, 0x2aff, + 0x2b30, 0x2b44, + 0x2b47, 0x2b4c, + 0xfb29, 0xfb29, + 0xfe61, 0xfe66, + 0xfe68, 0xfe68, + 0xff0b, 0xff0b, + 0xff1c, 0xff1e, + 0xff3c, 0xff3c, + 0xff3e, 0xff3e, + 0xff5c, 0xff5c, + 0xff5e, 0xff5e, + 0xffe2, 0xffe2, + 0xffe9, 0xffec, + 0x1d400, 0x1d454, + 0x1d456, 0x1d49c, + 0x1d49e, 0x1d49f, + 0x1d4a2, 0x1d4a2, + 0x1d4a5, 0x1d4a6, + 0x1d4a9, 0x1d4ac, + 0x1d4ae, 0x1d4b9, + 0x1d4bb, 0x1d4bb, + 0x1d4bd, 0x1d4c3, + 0x1d4c5, 0x1d505, + 0x1d507, 0x1d50a, + 0x1d50d, 0x1d514, + 0x1d516, 0x1d51c, + 0x1d51e, 0x1d539, + 0x1d53b, 0x1d53e, + 0x1d540, 0x1d544, + 0x1d546, 0x1d546, + 0x1d54a, 0x1d550, + 0x1d552, 0x1d6a5, + 0x1d6a8, 0x1d7cb, + 0x1d7ce, 0x1d7ff, +}; /* CR_Math */ + +/* 'Alphabetic': Derived Property */ +static const OnigCodePoint CR_Alphabetic[] = { + 474, + 0x0041, 0x005a, + 0x0061, 0x007a, + 0x00aa, 0x00aa, + 0x00b5, 0x00b5, + 0x00ba, 0x00ba, + 0x00c0, 0x00d6, + 0x00d8, 0x00f6, + 0x00f8, 0x02c1, + 0x02c6, 0x02d1, + 0x02e0, 0x02e4, + 0x02ec, 0x02ec, + 0x02ee, 0x02ee, + 0x0345, 0x0345, + 0x0370, 0x0374, + 0x0376, 0x0377, + 0x037a, 0x037d, + 0x0386, 0x0386, + 0x0388, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x03a1, + 0x03a3, 0x03f5, + 0x03f7, 0x0481, + 0x048a, 0x0525, + 0x0531, 0x0556, + 0x0559, 0x0559, + 0x0561, 0x0587, + 0x05b0, 0x05bd, + 0x05bf, 0x05bf, + 0x05c1, 0x05c2, + 0x05c4, 0x05c5, + 0x05c7, 0x05c7, + 0x05d0, 0x05ea, + 0x05f0, 0x05f2, + 0x0610, 0x061a, + 0x0621, 0x0657, + 0x0659, 0x065e, + 0x066e, 0x06d3, + 0x06d5, 0x06dc, + 0x06e1, 0x06e8, + 0x06ed, 0x06ef, + 0x06fa, 0x06fc, + 0x06ff, 0x06ff, + 0x0710, 0x073f, + 0x074d, 0x07b1, + 0x07ca, 0x07ea, + 0x07f4, 0x07f5, + 0x07fa, 0x07fa, + 0x0800, 0x0817, + 0x081a, 0x082c, + 0x0900, 0x0939, + 0x093d, 0x094c, + 0x094e, 0x094e, + 0x0950, 0x0950, + 0x0955, 0x0955, + 0x0958, 0x0963, + 0x0971, 0x0972, + 0x0979, 0x097f, + 0x0981, 0x0983, + 0x0985, 0x098c, + 0x098f, 0x0990, + 0x0993, 0x09a8, + 0x09aa, 0x09b0, + 0x09b2, 0x09b2, + 0x09b6, 0x09b9, + 0x09bd, 0x09c4, + 0x09c7, 0x09c8, + 0x09cb, 0x09cc, + 0x09ce, 0x09ce, + 0x09d7, 0x09d7, + 0x09dc, 0x09dd, + 0x09df, 0x09e3, + 0x09f0, 0x09f1, + 0x0a01, 0x0a03, + 0x0a05, 0x0a0a, + 0x0a0f, 0x0a10, + 0x0a13, 0x0a28, + 0x0a2a, 0x0a30, + 0x0a32, 0x0a33, + 0x0a35, 0x0a36, + 0x0a38, 0x0a39, + 0x0a3e, 0x0a42, + 0x0a47, 0x0a48, + 0x0a4b, 0x0a4c, + 0x0a51, 0x0a51, + 0x0a59, 0x0a5c, + 0x0a5e, 0x0a5e, + 0x0a70, 0x0a75, + 0x0a81, 0x0a83, + 0x0a85, 0x0a8d, + 0x0a8f, 0x0a91, + 0x0a93, 0x0aa8, + 0x0aaa, 0x0ab0, + 0x0ab2, 0x0ab3, + 0x0ab5, 0x0ab9, + 0x0abd, 0x0ac5, + 0x0ac7, 0x0ac9, + 0x0acb, 0x0acc, + 0x0ad0, 0x0ad0, + 0x0ae0, 0x0ae3, + 0x0b01, 0x0b03, + 0x0b05, 0x0b0c, + 0x0b0f, 0x0b10, + 0x0b13, 0x0b28, + 0x0b2a, 0x0b30, + 0x0b32, 0x0b33, + 0x0b35, 0x0b39, + 0x0b3d, 0x0b44, + 0x0b47, 0x0b48, + 0x0b4b, 0x0b4c, + 0x0b56, 0x0b57, + 0x0b5c, 0x0b5d, + 0x0b5f, 0x0b63, + 0x0b71, 0x0b71, + 0x0b82, 0x0b83, + 0x0b85, 0x0b8a, + 0x0b8e, 0x0b90, + 0x0b92, 0x0b95, + 0x0b99, 0x0b9a, + 0x0b9c, 0x0b9c, + 0x0b9e, 0x0b9f, + 0x0ba3, 0x0ba4, + 0x0ba8, 0x0baa, + 0x0bae, 0x0bb9, + 0x0bbe, 0x0bc2, + 0x0bc6, 0x0bc8, + 0x0bca, 0x0bcc, + 0x0bd0, 0x0bd0, + 0x0bd7, 0x0bd7, + 0x0c01, 0x0c03, + 0x0c05, 0x0c0c, + 0x0c0e, 0x0c10, + 0x0c12, 0x0c28, + 0x0c2a, 0x0c33, + 0x0c35, 0x0c39, + 0x0c3d, 0x0c44, + 0x0c46, 0x0c48, + 0x0c4a, 0x0c4c, + 0x0c55, 0x0c56, + 0x0c58, 0x0c59, + 0x0c60, 0x0c63, + 0x0c82, 0x0c83, + 0x0c85, 0x0c8c, + 0x0c8e, 0x0c90, + 0x0c92, 0x0ca8, + 0x0caa, 0x0cb3, + 0x0cb5, 0x0cb9, + 0x0cbd, 0x0cc4, + 0x0cc6, 0x0cc8, + 0x0cca, 0x0ccc, + 0x0cd5, 0x0cd6, + 0x0cde, 0x0cde, + 0x0ce0, 0x0ce3, + 0x0d02, 0x0d03, + 0x0d05, 0x0d0c, + 0x0d0e, 0x0d10, + 0x0d12, 0x0d28, + 0x0d2a, 0x0d39, + 0x0d3d, 0x0d44, + 0x0d46, 0x0d48, + 0x0d4a, 0x0d4c, + 0x0d57, 0x0d57, + 0x0d60, 0x0d63, + 0x0d7a, 0x0d7f, + 0x0d82, 0x0d83, + 0x0d85, 0x0d96, + 0x0d9a, 0x0db1, + 0x0db3, 0x0dbb, + 0x0dbd, 0x0dbd, + 0x0dc0, 0x0dc6, + 0x0dcf, 0x0dd4, + 0x0dd6, 0x0dd6, + 0x0dd8, 0x0ddf, + 0x0df2, 0x0df3, + 0x0e01, 0x0e3a, + 0x0e40, 0x0e46, + 0x0e4d, 0x0e4d, + 0x0e81, 0x0e82, + 0x0e84, 0x0e84, + 0x0e87, 0x0e88, + 0x0e8a, 0x0e8a, + 0x0e8d, 0x0e8d, + 0x0e94, 0x0e97, + 0x0e99, 0x0e9f, + 0x0ea1, 0x0ea3, + 0x0ea5, 0x0ea5, + 0x0ea7, 0x0ea7, + 0x0eaa, 0x0eab, + 0x0ead, 0x0eb9, + 0x0ebb, 0x0ebd, + 0x0ec0, 0x0ec4, + 0x0ec6, 0x0ec6, + 0x0ecd, 0x0ecd, + 0x0edc, 0x0edd, + 0x0f00, 0x0f00, + 0x0f40, 0x0f47, + 0x0f49, 0x0f6c, + 0x0f71, 0x0f81, + 0x0f88, 0x0f8b, + 0x0f90, 0x0f97, + 0x0f99, 0x0fbc, + 0x1000, 0x1036, + 0x1038, 0x1038, + 0x103b, 0x103f, + 0x1050, 0x1062, + 0x1065, 0x1068, + 0x106e, 0x1086, + 0x108e, 0x108e, + 0x109c, 0x109d, + 0x10a0, 0x10c5, + 0x10d0, 0x10fa, + 0x10fc, 0x10fc, + 0x1100, 0x1248, + 0x124a, 0x124d, + 0x1250, 0x1256, + 0x1258, 0x1258, + 0x125a, 0x125d, + 0x1260, 0x1288, + 0x128a, 0x128d, + 0x1290, 0x12b0, + 0x12b2, 0x12b5, + 0x12b8, 0x12be, + 0x12c0, 0x12c0, + 0x12c2, 0x12c5, + 0x12c8, 0x12d6, + 0x12d8, 0x1310, + 0x1312, 0x1315, + 0x1318, 0x135a, + 0x135f, 0x135f, + 0x1380, 0x138f, + 0x13a0, 0x13f4, + 0x1401, 0x166c, + 0x166f, 0x167f, + 0x1681, 0x169a, + 0x16a0, 0x16ea, + 0x16ee, 0x16f0, + 0x1700, 0x170c, + 0x170e, 0x1713, + 0x1720, 0x1733, + 0x1740, 0x1753, + 0x1760, 0x176c, + 0x176e, 0x1770, + 0x1772, 0x1773, + 0x1780, 0x17b3, + 0x17b6, 0x17c8, + 0x17d7, 0x17d7, + 0x17dc, 0x17dc, + 0x1820, 0x1877, + 0x1880, 0x18aa, + 0x18b0, 0x18f5, + 0x1900, 0x191c, + 0x1920, 0x192b, + 0x1930, 0x1938, + 0x1950, 0x196d, + 0x1970, 0x1974, + 0x1980, 0x19ab, + 0x19b0, 0x19c9, + 0x1a00, 0x1a1b, + 0x1a20, 0x1a5e, + 0x1a61, 0x1a74, + 0x1aa7, 0x1aa7, + 0x1b00, 0x1b33, + 0x1b35, 0x1b43, + 0x1b45, 0x1b4b, + 0x1b80, 0x1ba9, + 0x1bae, 0x1baf, + 0x1c00, 0x1c35, + 0x1c4d, 0x1c4f, + 0x1c5a, 0x1c7d, + 0x1ce9, 0x1cec, + 0x1cee, 0x1cf2, + 0x1d00, 0x1dbf, + 0x1e00, 0x1f15, + 0x1f18, 0x1f1d, + 0x1f20, 0x1f45, + 0x1f48, 0x1f4d, + 0x1f50, 0x1f57, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f7d, + 0x1f80, 0x1fb4, + 0x1fb6, 0x1fbc, + 0x1fbe, 0x1fbe, + 0x1fc2, 0x1fc4, + 0x1fc6, 0x1fcc, + 0x1fd0, 0x1fd3, + 0x1fd6, 0x1fdb, + 0x1fe0, 0x1fec, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ffc, + 0x2071, 0x2071, + 0x207f, 0x207f, + 0x2090, 0x2094, + 0x2102, 0x2102, + 0x2107, 0x2107, + 0x210a, 0x2113, + 0x2115, 0x2115, + 0x2119, 0x211d, + 0x2124, 0x2124, + 0x2126, 0x2126, + 0x2128, 0x2128, + 0x212a, 0x212d, + 0x212f, 0x2139, + 0x213c, 0x213f, + 0x2145, 0x2149, + 0x214e, 0x214e, + 0x2160, 0x2188, + 0x24b6, 0x24e9, + 0x2c00, 0x2c2e, + 0x2c30, 0x2c5e, + 0x2c60, 0x2ce4, + 0x2ceb, 0x2cee, + 0x2d00, 0x2d25, + 0x2d30, 0x2d65, + 0x2d6f, 0x2d6f, + 0x2d80, 0x2d96, + 0x2da0, 0x2da6, + 0x2da8, 0x2dae, + 0x2db0, 0x2db6, + 0x2db8, 0x2dbe, + 0x2dc0, 0x2dc6, + 0x2dc8, 0x2dce, + 0x2dd0, 0x2dd6, + 0x2dd8, 0x2dde, + 0x2de0, 0x2dff, + 0x2e2f, 0x2e2f, + 0x3005, 0x3007, + 0x3021, 0x3029, + 0x3031, 0x3035, + 0x3038, 0x303c, + 0x3041, 0x3096, + 0x309d, 0x309f, + 0x30a1, 0x30fa, + 0x30fc, 0x30ff, + 0x3105, 0x312d, + 0x3131, 0x318e, + 0x31a0, 0x31b7, + 0x31f0, 0x31ff, + 0x3400, 0x4db5, + 0x4e00, 0x9fcb, + 0xa000, 0xa48c, + 0xa4d0, 0xa4fd, + 0xa500, 0xa60c, + 0xa610, 0xa61f, + 0xa62a, 0xa62b, + 0xa640, 0xa65f, + 0xa662, 0xa66e, + 0xa67f, 0xa697, + 0xa6a0, 0xa6ef, + 0xa717, 0xa71f, + 0xa722, 0xa788, + 0xa78b, 0xa78c, + 0xa7fb, 0xa801, + 0xa803, 0xa805, + 0xa807, 0xa80a, + 0xa80c, 0xa827, + 0xa840, 0xa873, + 0xa880, 0xa8c3, + 0xa8f2, 0xa8f7, + 0xa8fb, 0xa8fb, + 0xa90a, 0xa92a, + 0xa930, 0xa952, + 0xa960, 0xa97c, + 0xa980, 0xa9bf, + 0xa9cf, 0xa9cf, + 0xaa00, 0xaa36, + 0xaa40, 0xaa4d, + 0xaa60, 0xaa76, + 0xaa7a, 0xaa7a, + 0xaa80, 0xaabe, + 0xaac0, 0xaac0, + 0xaac2, 0xaac2, + 0xaadb, 0xaadd, + 0xabc0, 0xabea, + 0xac00, 0xd7a3, + 0xd7b0, 0xd7c6, + 0xd7cb, 0xd7fb, + 0xf900, 0xfa2d, + 0xfa30, 0xfa6d, + 0xfa70, 0xfad9, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xfb1d, 0xfb28, + 0xfb2a, 0xfb36, + 0xfb38, 0xfb3c, + 0xfb3e, 0xfb3e, + 0xfb40, 0xfb41, + 0xfb43, 0xfb44, + 0xfb46, 0xfbb1, + 0xfbd3, 0xfd3d, + 0xfd50, 0xfd8f, + 0xfd92, 0xfdc7, + 0xfdf0, 0xfdfb, + 0xfe70, 0xfe74, + 0xfe76, 0xfefc, + 0xff21, 0xff3a, + 0xff41, 0xff5a, + 0xff66, 0xffbe, + 0xffc2, 0xffc7, + 0xffca, 0xffcf, + 0xffd2, 0xffd7, + 0xffda, 0xffdc, + 0x10000, 0x1000b, + 0x1000d, 0x10026, + 0x10028, 0x1003a, + 0x1003c, 0x1003d, + 0x1003f, 0x1004d, + 0x10050, 0x1005d, + 0x10080, 0x100fa, + 0x10140, 0x10174, + 0x10280, 0x1029c, + 0x102a0, 0x102d0, + 0x10300, 0x1031e, + 0x10330, 0x1034a, + 0x10380, 0x1039d, + 0x103a0, 0x103c3, + 0x103c8, 0x103cf, + 0x103d1, 0x103d5, + 0x10400, 0x1049d, + 0x10800, 0x10805, + 0x10808, 0x10808, + 0x1080a, 0x10835, + 0x10837, 0x10838, + 0x1083c, 0x1083c, + 0x1083f, 0x10855, + 0x10900, 0x10915, + 0x10920, 0x10939, + 0x10a00, 0x10a03, + 0x10a05, 0x10a06, + 0x10a0c, 0x10a13, + 0x10a15, 0x10a17, + 0x10a19, 0x10a33, + 0x10a60, 0x10a7c, + 0x10b00, 0x10b35, + 0x10b40, 0x10b55, + 0x10b60, 0x10b72, + 0x10c00, 0x10c48, + 0x11082, 0x110b8, + 0x12000, 0x1236e, + 0x12400, 0x12462, + 0x13000, 0x1342e, + 0x1d400, 0x1d454, + 0x1d456, 0x1d49c, + 0x1d49e, 0x1d49f, + 0x1d4a2, 0x1d4a2, + 0x1d4a5, 0x1d4a6, + 0x1d4a9, 0x1d4ac, + 0x1d4ae, 0x1d4b9, + 0x1d4bb, 0x1d4bb, + 0x1d4bd, 0x1d4c3, + 0x1d4c5, 0x1d505, + 0x1d507, 0x1d50a, + 0x1d50d, 0x1d514, + 0x1d516, 0x1d51c, + 0x1d51e, 0x1d539, + 0x1d53b, 0x1d53e, + 0x1d540, 0x1d544, + 0x1d546, 0x1d546, + 0x1d54a, 0x1d550, + 0x1d552, 0x1d6a5, + 0x1d6a8, 0x1d6c0, + 0x1d6c2, 0x1d6da, + 0x1d6dc, 0x1d6fa, + 0x1d6fc, 0x1d714, + 0x1d716, 0x1d734, + 0x1d736, 0x1d74e, + 0x1d750, 0x1d76e, + 0x1d770, 0x1d788, + 0x1d78a, 0x1d7a8, + 0x1d7aa, 0x1d7c2, + 0x1d7c4, 0x1d7cb, + 0x20000, 0x2a6d6, + 0x2a700, 0x2b734, + 0x2f800, 0x2fa1d, +}; /* CR_Alphabetic */ + +/* 'Lowercase': Derived Property */ +static const OnigCodePoint CR_Lowercase[] = { + 602, + 0x0061, 0x007a, + 0x00aa, 0x00aa, + 0x00b5, 0x00b5, + 0x00ba, 0x00ba, + 0x00df, 0x00f6, + 0x00f8, 0x00ff, + 0x0101, 0x0101, + 0x0103, 0x0103, + 0x0105, 0x0105, + 0x0107, 0x0107, + 0x0109, 0x0109, + 0x010b, 0x010b, + 0x010d, 0x010d, + 0x010f, 0x010f, + 0x0111, 0x0111, + 0x0113, 0x0113, + 0x0115, 0x0115, + 0x0117, 0x0117, + 0x0119, 0x0119, + 0x011b, 0x011b, + 0x011d, 0x011d, + 0x011f, 0x011f, + 0x0121, 0x0121, + 0x0123, 0x0123, + 0x0125, 0x0125, + 0x0127, 0x0127, + 0x0129, 0x0129, + 0x012b, 0x012b, + 0x012d, 0x012d, + 0x012f, 0x012f, + 0x0131, 0x0131, + 0x0133, 0x0133, + 0x0135, 0x0135, + 0x0137, 0x0138, + 0x013a, 0x013a, + 0x013c, 0x013c, + 0x013e, 0x013e, + 0x0140, 0x0140, + 0x0142, 0x0142, + 0x0144, 0x0144, + 0x0146, 0x0146, + 0x0148, 0x0149, + 0x014b, 0x014b, + 0x014d, 0x014d, + 0x014f, 0x014f, + 0x0151, 0x0151, + 0x0153, 0x0153, + 0x0155, 0x0155, + 0x0157, 0x0157, + 0x0159, 0x0159, + 0x015b, 0x015b, + 0x015d, 0x015d, + 0x015f, 0x015f, + 0x0161, 0x0161, + 0x0163, 0x0163, + 0x0165, 0x0165, + 0x0167, 0x0167, + 0x0169, 0x0169, + 0x016b, 0x016b, + 0x016d, 0x016d, + 0x016f, 0x016f, + 0x0171, 0x0171, + 0x0173, 0x0173, + 0x0175, 0x0175, + 0x0177, 0x0177, + 0x017a, 0x017a, + 0x017c, 0x017c, + 0x017e, 0x0180, + 0x0183, 0x0183, + 0x0185, 0x0185, + 0x0188, 0x0188, + 0x018c, 0x018d, + 0x0192, 0x0192, + 0x0195, 0x0195, + 0x0199, 0x019b, + 0x019e, 0x019e, + 0x01a1, 0x01a1, + 0x01a3, 0x01a3, + 0x01a5, 0x01a5, + 0x01a8, 0x01a8, + 0x01aa, 0x01ab, + 0x01ad, 0x01ad, + 0x01b0, 0x01b0, + 0x01b4, 0x01b4, + 0x01b6, 0x01b6, + 0x01b9, 0x01ba, + 0x01bd, 0x01bf, + 0x01c6, 0x01c6, + 0x01c9, 0x01c9, + 0x01cc, 0x01cc, + 0x01ce, 0x01ce, + 0x01d0, 0x01d0, + 0x01d2, 0x01d2, + 0x01d4, 0x01d4, + 0x01d6, 0x01d6, + 0x01d8, 0x01d8, + 0x01da, 0x01da, + 0x01dc, 0x01dd, + 0x01df, 0x01df, + 0x01e1, 0x01e1, + 0x01e3, 0x01e3, + 0x01e5, 0x01e5, + 0x01e7, 0x01e7, + 0x01e9, 0x01e9, + 0x01eb, 0x01eb, + 0x01ed, 0x01ed, + 0x01ef, 0x01f0, + 0x01f3, 0x01f3, + 0x01f5, 0x01f5, + 0x01f9, 0x01f9, + 0x01fb, 0x01fb, + 0x01fd, 0x01fd, + 0x01ff, 0x01ff, + 0x0201, 0x0201, + 0x0203, 0x0203, + 0x0205, 0x0205, + 0x0207, 0x0207, + 0x0209, 0x0209, + 0x020b, 0x020b, + 0x020d, 0x020d, + 0x020f, 0x020f, + 0x0211, 0x0211, + 0x0213, 0x0213, + 0x0215, 0x0215, + 0x0217, 0x0217, + 0x0219, 0x0219, + 0x021b, 0x021b, + 0x021d, 0x021d, + 0x021f, 0x021f, + 0x0221, 0x0221, + 0x0223, 0x0223, + 0x0225, 0x0225, + 0x0227, 0x0227, + 0x0229, 0x0229, + 0x022b, 0x022b, + 0x022d, 0x022d, + 0x022f, 0x022f, + 0x0231, 0x0231, + 0x0233, 0x0239, + 0x023c, 0x023c, + 0x023f, 0x0240, + 0x0242, 0x0242, + 0x0247, 0x0247, + 0x0249, 0x0249, + 0x024b, 0x024b, + 0x024d, 0x024d, + 0x024f, 0x0293, + 0x0295, 0x02b8, + 0x02c0, 0x02c1, + 0x02e0, 0x02e4, + 0x0345, 0x0345, + 0x0371, 0x0371, + 0x0373, 0x0373, + 0x0377, 0x0377, + 0x037a, 0x037d, + 0x0390, 0x0390, + 0x03ac, 0x03ce, + 0x03d0, 0x03d1, + 0x03d5, 0x03d7, + 0x03d9, 0x03d9, + 0x03db, 0x03db, + 0x03dd, 0x03dd, + 0x03df, 0x03df, + 0x03e1, 0x03e1, + 0x03e3, 0x03e3, + 0x03e5, 0x03e5, + 0x03e7, 0x03e7, + 0x03e9, 0x03e9, + 0x03eb, 0x03eb, + 0x03ed, 0x03ed, + 0x03ef, 0x03f3, + 0x03f5, 0x03f5, + 0x03f8, 0x03f8, + 0x03fb, 0x03fc, + 0x0430, 0x045f, + 0x0461, 0x0461, + 0x0463, 0x0463, + 0x0465, 0x0465, + 0x0467, 0x0467, + 0x0469, 0x0469, + 0x046b, 0x046b, + 0x046d, 0x046d, + 0x046f, 0x046f, + 0x0471, 0x0471, + 0x0473, 0x0473, + 0x0475, 0x0475, + 0x0477, 0x0477, + 0x0479, 0x0479, + 0x047b, 0x047b, + 0x047d, 0x047d, + 0x047f, 0x047f, + 0x0481, 0x0481, + 0x048b, 0x048b, + 0x048d, 0x048d, + 0x048f, 0x048f, + 0x0491, 0x0491, + 0x0493, 0x0493, + 0x0495, 0x0495, + 0x0497, 0x0497, + 0x0499, 0x0499, + 0x049b, 0x049b, + 0x049d, 0x049d, + 0x049f, 0x049f, + 0x04a1, 0x04a1, + 0x04a3, 0x04a3, + 0x04a5, 0x04a5, + 0x04a7, 0x04a7, + 0x04a9, 0x04a9, + 0x04ab, 0x04ab, + 0x04ad, 0x04ad, + 0x04af, 0x04af, + 0x04b1, 0x04b1, + 0x04b3, 0x04b3, + 0x04b5, 0x04b5, + 0x04b7, 0x04b7, + 0x04b9, 0x04b9, + 0x04bb, 0x04bb, + 0x04bd, 0x04bd, + 0x04bf, 0x04bf, + 0x04c2, 0x04c2, + 0x04c4, 0x04c4, + 0x04c6, 0x04c6, + 0x04c8, 0x04c8, + 0x04ca, 0x04ca, + 0x04cc, 0x04cc, + 0x04ce, 0x04cf, + 0x04d1, 0x04d1, + 0x04d3, 0x04d3, + 0x04d5, 0x04d5, + 0x04d7, 0x04d7, + 0x04d9, 0x04d9, + 0x04db, 0x04db, + 0x04dd, 0x04dd, + 0x04df, 0x04df, + 0x04e1, 0x04e1, + 0x04e3, 0x04e3, + 0x04e5, 0x04e5, + 0x04e7, 0x04e7, + 0x04e9, 0x04e9, + 0x04eb, 0x04eb, + 0x04ed, 0x04ed, + 0x04ef, 0x04ef, + 0x04f1, 0x04f1, + 0x04f3, 0x04f3, + 0x04f5, 0x04f5, + 0x04f7, 0x04f7, + 0x04f9, 0x04f9, + 0x04fb, 0x04fb, + 0x04fd, 0x04fd, + 0x04ff, 0x04ff, + 0x0501, 0x0501, + 0x0503, 0x0503, + 0x0505, 0x0505, + 0x0507, 0x0507, + 0x0509, 0x0509, + 0x050b, 0x050b, + 0x050d, 0x050d, + 0x050f, 0x050f, + 0x0511, 0x0511, + 0x0513, 0x0513, + 0x0515, 0x0515, + 0x0517, 0x0517, + 0x0519, 0x0519, + 0x051b, 0x051b, + 0x051d, 0x051d, + 0x051f, 0x051f, + 0x0521, 0x0521, + 0x0523, 0x0523, + 0x0525, 0x0525, + 0x0561, 0x0587, + 0x1d00, 0x1dbf, + 0x1e01, 0x1e01, + 0x1e03, 0x1e03, + 0x1e05, 0x1e05, + 0x1e07, 0x1e07, + 0x1e09, 0x1e09, + 0x1e0b, 0x1e0b, + 0x1e0d, 0x1e0d, + 0x1e0f, 0x1e0f, + 0x1e11, 0x1e11, + 0x1e13, 0x1e13, + 0x1e15, 0x1e15, + 0x1e17, 0x1e17, + 0x1e19, 0x1e19, + 0x1e1b, 0x1e1b, + 0x1e1d, 0x1e1d, + 0x1e1f, 0x1e1f, + 0x1e21, 0x1e21, + 0x1e23, 0x1e23, + 0x1e25, 0x1e25, + 0x1e27, 0x1e27, + 0x1e29, 0x1e29, + 0x1e2b, 0x1e2b, + 0x1e2d, 0x1e2d, + 0x1e2f, 0x1e2f, + 0x1e31, 0x1e31, + 0x1e33, 0x1e33, + 0x1e35, 0x1e35, + 0x1e37, 0x1e37, + 0x1e39, 0x1e39, + 0x1e3b, 0x1e3b, + 0x1e3d, 0x1e3d, + 0x1e3f, 0x1e3f, + 0x1e41, 0x1e41, + 0x1e43, 0x1e43, + 0x1e45, 0x1e45, + 0x1e47, 0x1e47, + 0x1e49, 0x1e49, + 0x1e4b, 0x1e4b, + 0x1e4d, 0x1e4d, + 0x1e4f, 0x1e4f, + 0x1e51, 0x1e51, + 0x1e53, 0x1e53, + 0x1e55, 0x1e55, + 0x1e57, 0x1e57, + 0x1e59, 0x1e59, + 0x1e5b, 0x1e5b, + 0x1e5d, 0x1e5d, + 0x1e5f, 0x1e5f, + 0x1e61, 0x1e61, + 0x1e63, 0x1e63, + 0x1e65, 0x1e65, + 0x1e67, 0x1e67, + 0x1e69, 0x1e69, + 0x1e6b, 0x1e6b, + 0x1e6d, 0x1e6d, + 0x1e6f, 0x1e6f, + 0x1e71, 0x1e71, + 0x1e73, 0x1e73, + 0x1e75, 0x1e75, + 0x1e77, 0x1e77, + 0x1e79, 0x1e79, + 0x1e7b, 0x1e7b, + 0x1e7d, 0x1e7d, + 0x1e7f, 0x1e7f, + 0x1e81, 0x1e81, + 0x1e83, 0x1e83, + 0x1e85, 0x1e85, + 0x1e87, 0x1e87, + 0x1e89, 0x1e89, + 0x1e8b, 0x1e8b, + 0x1e8d, 0x1e8d, + 0x1e8f, 0x1e8f, + 0x1e91, 0x1e91, + 0x1e93, 0x1e93, + 0x1e95, 0x1e9d, + 0x1e9f, 0x1e9f, + 0x1ea1, 0x1ea1, + 0x1ea3, 0x1ea3, + 0x1ea5, 0x1ea5, + 0x1ea7, 0x1ea7, + 0x1ea9, 0x1ea9, + 0x1eab, 0x1eab, + 0x1ead, 0x1ead, + 0x1eaf, 0x1eaf, + 0x1eb1, 0x1eb1, + 0x1eb3, 0x1eb3, + 0x1eb5, 0x1eb5, + 0x1eb7, 0x1eb7, + 0x1eb9, 0x1eb9, + 0x1ebb, 0x1ebb, + 0x1ebd, 0x1ebd, + 0x1ebf, 0x1ebf, + 0x1ec1, 0x1ec1, + 0x1ec3, 0x1ec3, + 0x1ec5, 0x1ec5, + 0x1ec7, 0x1ec7, + 0x1ec9, 0x1ec9, + 0x1ecb, 0x1ecb, + 0x1ecd, 0x1ecd, + 0x1ecf, 0x1ecf, + 0x1ed1, 0x1ed1, + 0x1ed3, 0x1ed3, + 0x1ed5, 0x1ed5, + 0x1ed7, 0x1ed7, + 0x1ed9, 0x1ed9, + 0x1edb, 0x1edb, + 0x1edd, 0x1edd, + 0x1edf, 0x1edf, + 0x1ee1, 0x1ee1, + 0x1ee3, 0x1ee3, + 0x1ee5, 0x1ee5, + 0x1ee7, 0x1ee7, + 0x1ee9, 0x1ee9, + 0x1eeb, 0x1eeb, + 0x1eed, 0x1eed, + 0x1eef, 0x1eef, + 0x1ef1, 0x1ef1, + 0x1ef3, 0x1ef3, + 0x1ef5, 0x1ef5, + 0x1ef7, 0x1ef7, + 0x1ef9, 0x1ef9, + 0x1efb, 0x1efb, + 0x1efd, 0x1efd, + 0x1eff, 0x1f07, + 0x1f10, 0x1f15, + 0x1f20, 0x1f27, + 0x1f30, 0x1f37, + 0x1f40, 0x1f45, + 0x1f50, 0x1f57, + 0x1f60, 0x1f67, + 0x1f70, 0x1f7d, + 0x1f80, 0x1f87, + 0x1f90, 0x1f97, + 0x1fa0, 0x1fa7, + 0x1fb0, 0x1fb4, + 0x1fb6, 0x1fb7, + 0x1fbe, 0x1fbe, + 0x1fc2, 0x1fc4, + 0x1fc6, 0x1fc7, + 0x1fd0, 0x1fd3, + 0x1fd6, 0x1fd7, + 0x1fe0, 0x1fe7, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ff7, + 0x2090, 0x2094, + 0x210a, 0x210a, + 0x210e, 0x210f, + 0x2113, 0x2113, + 0x212f, 0x212f, + 0x2134, 0x2134, + 0x2139, 0x2139, + 0x213c, 0x213d, + 0x2146, 0x2149, + 0x214e, 0x214e, + 0x2170, 0x217f, + 0x2184, 0x2184, + 0x24d0, 0x24e9, + 0x2c30, 0x2c5e, + 0x2c61, 0x2c61, + 0x2c65, 0x2c66, + 0x2c68, 0x2c68, + 0x2c6a, 0x2c6a, + 0x2c6c, 0x2c6c, + 0x2c71, 0x2c71, + 0x2c73, 0x2c74, + 0x2c76, 0x2c7d, + 0x2c81, 0x2c81, + 0x2c83, 0x2c83, + 0x2c85, 0x2c85, + 0x2c87, 0x2c87, + 0x2c89, 0x2c89, + 0x2c8b, 0x2c8b, + 0x2c8d, 0x2c8d, + 0x2c8f, 0x2c8f, + 0x2c91, 0x2c91, + 0x2c93, 0x2c93, + 0x2c95, 0x2c95, + 0x2c97, 0x2c97, + 0x2c99, 0x2c99, + 0x2c9b, 0x2c9b, + 0x2c9d, 0x2c9d, + 0x2c9f, 0x2c9f, + 0x2ca1, 0x2ca1, + 0x2ca3, 0x2ca3, + 0x2ca5, 0x2ca5, + 0x2ca7, 0x2ca7, + 0x2ca9, 0x2ca9, + 0x2cab, 0x2cab, + 0x2cad, 0x2cad, + 0x2caf, 0x2caf, + 0x2cb1, 0x2cb1, + 0x2cb3, 0x2cb3, + 0x2cb5, 0x2cb5, + 0x2cb7, 0x2cb7, + 0x2cb9, 0x2cb9, + 0x2cbb, 0x2cbb, + 0x2cbd, 0x2cbd, + 0x2cbf, 0x2cbf, + 0x2cc1, 0x2cc1, + 0x2cc3, 0x2cc3, + 0x2cc5, 0x2cc5, + 0x2cc7, 0x2cc7, + 0x2cc9, 0x2cc9, + 0x2ccb, 0x2ccb, + 0x2ccd, 0x2ccd, + 0x2ccf, 0x2ccf, + 0x2cd1, 0x2cd1, + 0x2cd3, 0x2cd3, + 0x2cd5, 0x2cd5, + 0x2cd7, 0x2cd7, + 0x2cd9, 0x2cd9, + 0x2cdb, 0x2cdb, + 0x2cdd, 0x2cdd, + 0x2cdf, 0x2cdf, + 0x2ce1, 0x2ce1, + 0x2ce3, 0x2ce4, + 0x2cec, 0x2cec, + 0x2cee, 0x2cee, + 0x2d00, 0x2d25, + 0xa641, 0xa641, + 0xa643, 0xa643, + 0xa645, 0xa645, + 0xa647, 0xa647, + 0xa649, 0xa649, + 0xa64b, 0xa64b, + 0xa64d, 0xa64d, + 0xa64f, 0xa64f, + 0xa651, 0xa651, + 0xa653, 0xa653, + 0xa655, 0xa655, + 0xa657, 0xa657, + 0xa659, 0xa659, + 0xa65b, 0xa65b, + 0xa65d, 0xa65d, + 0xa65f, 0xa65f, + 0xa663, 0xa663, + 0xa665, 0xa665, + 0xa667, 0xa667, + 0xa669, 0xa669, + 0xa66b, 0xa66b, + 0xa66d, 0xa66d, + 0xa681, 0xa681, + 0xa683, 0xa683, + 0xa685, 0xa685, + 0xa687, 0xa687, + 0xa689, 0xa689, + 0xa68b, 0xa68b, + 0xa68d, 0xa68d, + 0xa68f, 0xa68f, + 0xa691, 0xa691, + 0xa693, 0xa693, + 0xa695, 0xa695, + 0xa697, 0xa697, + 0xa723, 0xa723, + 0xa725, 0xa725, + 0xa727, 0xa727, + 0xa729, 0xa729, + 0xa72b, 0xa72b, + 0xa72d, 0xa72d, + 0xa72f, 0xa731, + 0xa733, 0xa733, + 0xa735, 0xa735, + 0xa737, 0xa737, + 0xa739, 0xa739, + 0xa73b, 0xa73b, + 0xa73d, 0xa73d, + 0xa73f, 0xa73f, + 0xa741, 0xa741, + 0xa743, 0xa743, + 0xa745, 0xa745, + 0xa747, 0xa747, + 0xa749, 0xa749, + 0xa74b, 0xa74b, + 0xa74d, 0xa74d, + 0xa74f, 0xa74f, + 0xa751, 0xa751, + 0xa753, 0xa753, + 0xa755, 0xa755, + 0xa757, 0xa757, + 0xa759, 0xa759, + 0xa75b, 0xa75b, + 0xa75d, 0xa75d, + 0xa75f, 0xa75f, + 0xa761, 0xa761, + 0xa763, 0xa763, + 0xa765, 0xa765, + 0xa767, 0xa767, + 0xa769, 0xa769, + 0xa76b, 0xa76b, + 0xa76d, 0xa76d, + 0xa76f, 0xa778, + 0xa77a, 0xa77a, + 0xa77c, 0xa77c, + 0xa77f, 0xa77f, + 0xa781, 0xa781, + 0xa783, 0xa783, + 0xa785, 0xa785, + 0xa787, 0xa787, + 0xa78c, 0xa78c, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xff41, 0xff5a, + 0x10428, 0x1044f, + 0x1d41a, 0x1d433, + 0x1d44e, 0x1d454, + 0x1d456, 0x1d467, + 0x1d482, 0x1d49b, + 0x1d4b6, 0x1d4b9, + 0x1d4bb, 0x1d4bb, + 0x1d4bd, 0x1d4c3, + 0x1d4c5, 0x1d4cf, + 0x1d4ea, 0x1d503, + 0x1d51e, 0x1d537, + 0x1d552, 0x1d56b, + 0x1d586, 0x1d59f, + 0x1d5ba, 0x1d5d3, + 0x1d5ee, 0x1d607, + 0x1d622, 0x1d63b, + 0x1d656, 0x1d66f, + 0x1d68a, 0x1d6a5, + 0x1d6c2, 0x1d6da, + 0x1d6dc, 0x1d6e1, + 0x1d6fc, 0x1d714, + 0x1d716, 0x1d71b, + 0x1d736, 0x1d74e, + 0x1d750, 0x1d755, + 0x1d770, 0x1d788, + 0x1d78a, 0x1d78f, + 0x1d7aa, 0x1d7c2, + 0x1d7c4, 0x1d7c9, + 0x1d7cb, 0x1d7cb, +}; /* CR_Lowercase */ + +/* 'Uppercase': Derived Property */ +static const OnigCodePoint CR_Uppercase[] = { + 596, + 0x0041, 0x005a, + 0x00c0, 0x00d6, + 0x00d8, 0x00de, + 0x0100, 0x0100, + 0x0102, 0x0102, + 0x0104, 0x0104, + 0x0106, 0x0106, + 0x0108, 0x0108, + 0x010a, 0x010a, + 0x010c, 0x010c, + 0x010e, 0x010e, + 0x0110, 0x0110, + 0x0112, 0x0112, + 0x0114, 0x0114, + 0x0116, 0x0116, + 0x0118, 0x0118, + 0x011a, 0x011a, + 0x011c, 0x011c, + 0x011e, 0x011e, + 0x0120, 0x0120, + 0x0122, 0x0122, + 0x0124, 0x0124, + 0x0126, 0x0126, + 0x0128, 0x0128, + 0x012a, 0x012a, + 0x012c, 0x012c, + 0x012e, 0x012e, + 0x0130, 0x0130, + 0x0132, 0x0132, + 0x0134, 0x0134, + 0x0136, 0x0136, + 0x0139, 0x0139, + 0x013b, 0x013b, + 0x013d, 0x013d, + 0x013f, 0x013f, + 0x0141, 0x0141, + 0x0143, 0x0143, + 0x0145, 0x0145, + 0x0147, 0x0147, + 0x014a, 0x014a, + 0x014c, 0x014c, + 0x014e, 0x014e, + 0x0150, 0x0150, + 0x0152, 0x0152, + 0x0154, 0x0154, + 0x0156, 0x0156, + 0x0158, 0x0158, + 0x015a, 0x015a, + 0x015c, 0x015c, + 0x015e, 0x015e, + 0x0160, 0x0160, + 0x0162, 0x0162, + 0x0164, 0x0164, + 0x0166, 0x0166, + 0x0168, 0x0168, + 0x016a, 0x016a, + 0x016c, 0x016c, + 0x016e, 0x016e, + 0x0170, 0x0170, + 0x0172, 0x0172, + 0x0174, 0x0174, + 0x0176, 0x0176, + 0x0178, 0x0179, + 0x017b, 0x017b, + 0x017d, 0x017d, + 0x0181, 0x0182, + 0x0184, 0x0184, + 0x0186, 0x0187, + 0x0189, 0x018b, + 0x018e, 0x0191, + 0x0193, 0x0194, + 0x0196, 0x0198, + 0x019c, 0x019d, + 0x019f, 0x01a0, + 0x01a2, 0x01a2, + 0x01a4, 0x01a4, + 0x01a6, 0x01a7, + 0x01a9, 0x01a9, + 0x01ac, 0x01ac, + 0x01ae, 0x01af, + 0x01b1, 0x01b3, + 0x01b5, 0x01b5, + 0x01b7, 0x01b8, + 0x01bc, 0x01bc, + 0x01c4, 0x01c4, + 0x01c7, 0x01c7, + 0x01ca, 0x01ca, + 0x01cd, 0x01cd, + 0x01cf, 0x01cf, + 0x01d1, 0x01d1, + 0x01d3, 0x01d3, + 0x01d5, 0x01d5, + 0x01d7, 0x01d7, + 0x01d9, 0x01d9, + 0x01db, 0x01db, + 0x01de, 0x01de, + 0x01e0, 0x01e0, + 0x01e2, 0x01e2, + 0x01e4, 0x01e4, + 0x01e6, 0x01e6, + 0x01e8, 0x01e8, + 0x01ea, 0x01ea, + 0x01ec, 0x01ec, + 0x01ee, 0x01ee, + 0x01f1, 0x01f1, + 0x01f4, 0x01f4, + 0x01f6, 0x01f8, + 0x01fa, 0x01fa, + 0x01fc, 0x01fc, + 0x01fe, 0x01fe, + 0x0200, 0x0200, + 0x0202, 0x0202, + 0x0204, 0x0204, + 0x0206, 0x0206, + 0x0208, 0x0208, + 0x020a, 0x020a, + 0x020c, 0x020c, + 0x020e, 0x020e, + 0x0210, 0x0210, + 0x0212, 0x0212, + 0x0214, 0x0214, + 0x0216, 0x0216, + 0x0218, 0x0218, + 0x021a, 0x021a, + 0x021c, 0x021c, + 0x021e, 0x021e, + 0x0220, 0x0220, + 0x0222, 0x0222, + 0x0224, 0x0224, + 0x0226, 0x0226, + 0x0228, 0x0228, + 0x022a, 0x022a, + 0x022c, 0x022c, + 0x022e, 0x022e, + 0x0230, 0x0230, + 0x0232, 0x0232, + 0x023a, 0x023b, + 0x023d, 0x023e, + 0x0241, 0x0241, + 0x0243, 0x0246, + 0x0248, 0x0248, + 0x024a, 0x024a, + 0x024c, 0x024c, + 0x024e, 0x024e, + 0x0370, 0x0370, + 0x0372, 0x0372, + 0x0376, 0x0376, + 0x0386, 0x0386, + 0x0388, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x038f, + 0x0391, 0x03a1, + 0x03a3, 0x03ab, + 0x03cf, 0x03cf, + 0x03d2, 0x03d4, + 0x03d8, 0x03d8, + 0x03da, 0x03da, + 0x03dc, 0x03dc, + 0x03de, 0x03de, + 0x03e0, 0x03e0, + 0x03e2, 0x03e2, + 0x03e4, 0x03e4, + 0x03e6, 0x03e6, + 0x03e8, 0x03e8, + 0x03ea, 0x03ea, + 0x03ec, 0x03ec, + 0x03ee, 0x03ee, + 0x03f4, 0x03f4, + 0x03f7, 0x03f7, + 0x03f9, 0x03fa, + 0x03fd, 0x042f, + 0x0460, 0x0460, + 0x0462, 0x0462, + 0x0464, 0x0464, + 0x0466, 0x0466, + 0x0468, 0x0468, + 0x046a, 0x046a, + 0x046c, 0x046c, + 0x046e, 0x046e, + 0x0470, 0x0470, + 0x0472, 0x0472, + 0x0474, 0x0474, + 0x0476, 0x0476, + 0x0478, 0x0478, + 0x047a, 0x047a, + 0x047c, 0x047c, + 0x047e, 0x047e, + 0x0480, 0x0480, + 0x048a, 0x048a, + 0x048c, 0x048c, + 0x048e, 0x048e, + 0x0490, 0x0490, + 0x0492, 0x0492, + 0x0494, 0x0494, + 0x0496, 0x0496, + 0x0498, 0x0498, + 0x049a, 0x049a, + 0x049c, 0x049c, + 0x049e, 0x049e, + 0x04a0, 0x04a0, + 0x04a2, 0x04a2, + 0x04a4, 0x04a4, + 0x04a6, 0x04a6, + 0x04a8, 0x04a8, + 0x04aa, 0x04aa, + 0x04ac, 0x04ac, + 0x04ae, 0x04ae, + 0x04b0, 0x04b0, + 0x04b2, 0x04b2, + 0x04b4, 0x04b4, + 0x04b6, 0x04b6, + 0x04b8, 0x04b8, + 0x04ba, 0x04ba, + 0x04bc, 0x04bc, + 0x04be, 0x04be, + 0x04c0, 0x04c1, + 0x04c3, 0x04c3, + 0x04c5, 0x04c5, + 0x04c7, 0x04c7, + 0x04c9, 0x04c9, + 0x04cb, 0x04cb, + 0x04cd, 0x04cd, + 0x04d0, 0x04d0, + 0x04d2, 0x04d2, + 0x04d4, 0x04d4, + 0x04d6, 0x04d6, + 0x04d8, 0x04d8, + 0x04da, 0x04da, + 0x04dc, 0x04dc, + 0x04de, 0x04de, + 0x04e0, 0x04e0, + 0x04e2, 0x04e2, + 0x04e4, 0x04e4, + 0x04e6, 0x04e6, + 0x04e8, 0x04e8, + 0x04ea, 0x04ea, + 0x04ec, 0x04ec, + 0x04ee, 0x04ee, + 0x04f0, 0x04f0, + 0x04f2, 0x04f2, + 0x04f4, 0x04f4, + 0x04f6, 0x04f6, + 0x04f8, 0x04f8, + 0x04fa, 0x04fa, + 0x04fc, 0x04fc, + 0x04fe, 0x04fe, + 0x0500, 0x0500, + 0x0502, 0x0502, + 0x0504, 0x0504, + 0x0506, 0x0506, + 0x0508, 0x0508, + 0x050a, 0x050a, + 0x050c, 0x050c, + 0x050e, 0x050e, + 0x0510, 0x0510, + 0x0512, 0x0512, + 0x0514, 0x0514, + 0x0516, 0x0516, + 0x0518, 0x0518, + 0x051a, 0x051a, + 0x051c, 0x051c, + 0x051e, 0x051e, + 0x0520, 0x0520, + 0x0522, 0x0522, + 0x0524, 0x0524, + 0x0531, 0x0556, + 0x10a0, 0x10c5, + 0x1e00, 0x1e00, + 0x1e02, 0x1e02, + 0x1e04, 0x1e04, + 0x1e06, 0x1e06, + 0x1e08, 0x1e08, + 0x1e0a, 0x1e0a, + 0x1e0c, 0x1e0c, + 0x1e0e, 0x1e0e, + 0x1e10, 0x1e10, + 0x1e12, 0x1e12, + 0x1e14, 0x1e14, + 0x1e16, 0x1e16, + 0x1e18, 0x1e18, + 0x1e1a, 0x1e1a, + 0x1e1c, 0x1e1c, + 0x1e1e, 0x1e1e, + 0x1e20, 0x1e20, + 0x1e22, 0x1e22, + 0x1e24, 0x1e24, + 0x1e26, 0x1e26, + 0x1e28, 0x1e28, + 0x1e2a, 0x1e2a, + 0x1e2c, 0x1e2c, + 0x1e2e, 0x1e2e, + 0x1e30, 0x1e30, + 0x1e32, 0x1e32, + 0x1e34, 0x1e34, + 0x1e36, 0x1e36, + 0x1e38, 0x1e38, + 0x1e3a, 0x1e3a, + 0x1e3c, 0x1e3c, + 0x1e3e, 0x1e3e, + 0x1e40, 0x1e40, + 0x1e42, 0x1e42, + 0x1e44, 0x1e44, + 0x1e46, 0x1e46, + 0x1e48, 0x1e48, + 0x1e4a, 0x1e4a, + 0x1e4c, 0x1e4c, + 0x1e4e, 0x1e4e, + 0x1e50, 0x1e50, + 0x1e52, 0x1e52, + 0x1e54, 0x1e54, + 0x1e56, 0x1e56, + 0x1e58, 0x1e58, + 0x1e5a, 0x1e5a, + 0x1e5c, 0x1e5c, + 0x1e5e, 0x1e5e, + 0x1e60, 0x1e60, + 0x1e62, 0x1e62, + 0x1e64, 0x1e64, + 0x1e66, 0x1e66, + 0x1e68, 0x1e68, + 0x1e6a, 0x1e6a, + 0x1e6c, 0x1e6c, + 0x1e6e, 0x1e6e, + 0x1e70, 0x1e70, + 0x1e72, 0x1e72, + 0x1e74, 0x1e74, + 0x1e76, 0x1e76, + 0x1e78, 0x1e78, + 0x1e7a, 0x1e7a, + 0x1e7c, 0x1e7c, + 0x1e7e, 0x1e7e, + 0x1e80, 0x1e80, + 0x1e82, 0x1e82, + 0x1e84, 0x1e84, + 0x1e86, 0x1e86, + 0x1e88, 0x1e88, + 0x1e8a, 0x1e8a, + 0x1e8c, 0x1e8c, + 0x1e8e, 0x1e8e, + 0x1e90, 0x1e90, + 0x1e92, 0x1e92, + 0x1e94, 0x1e94, + 0x1e9e, 0x1e9e, + 0x1ea0, 0x1ea0, + 0x1ea2, 0x1ea2, + 0x1ea4, 0x1ea4, + 0x1ea6, 0x1ea6, + 0x1ea8, 0x1ea8, + 0x1eaa, 0x1eaa, + 0x1eac, 0x1eac, + 0x1eae, 0x1eae, + 0x1eb0, 0x1eb0, + 0x1eb2, 0x1eb2, + 0x1eb4, 0x1eb4, + 0x1eb6, 0x1eb6, + 0x1eb8, 0x1eb8, + 0x1eba, 0x1eba, + 0x1ebc, 0x1ebc, + 0x1ebe, 0x1ebe, + 0x1ec0, 0x1ec0, + 0x1ec2, 0x1ec2, + 0x1ec4, 0x1ec4, + 0x1ec6, 0x1ec6, + 0x1ec8, 0x1ec8, + 0x1eca, 0x1eca, + 0x1ecc, 0x1ecc, + 0x1ece, 0x1ece, + 0x1ed0, 0x1ed0, + 0x1ed2, 0x1ed2, + 0x1ed4, 0x1ed4, + 0x1ed6, 0x1ed6, + 0x1ed8, 0x1ed8, + 0x1eda, 0x1eda, + 0x1edc, 0x1edc, + 0x1ede, 0x1ede, + 0x1ee0, 0x1ee0, + 0x1ee2, 0x1ee2, + 0x1ee4, 0x1ee4, + 0x1ee6, 0x1ee6, + 0x1ee8, 0x1ee8, + 0x1eea, 0x1eea, + 0x1eec, 0x1eec, + 0x1eee, 0x1eee, + 0x1ef0, 0x1ef0, + 0x1ef2, 0x1ef2, + 0x1ef4, 0x1ef4, + 0x1ef6, 0x1ef6, + 0x1ef8, 0x1ef8, + 0x1efa, 0x1efa, + 0x1efc, 0x1efc, + 0x1efe, 0x1efe, + 0x1f08, 0x1f0f, + 0x1f18, 0x1f1d, + 0x1f28, 0x1f2f, + 0x1f38, 0x1f3f, + 0x1f48, 0x1f4d, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f5f, + 0x1f68, 0x1f6f, + 0x1fb8, 0x1fbb, + 0x1fc8, 0x1fcb, + 0x1fd8, 0x1fdb, + 0x1fe8, 0x1fec, + 0x1ff8, 0x1ffb, + 0x2102, 0x2102, + 0x2107, 0x2107, + 0x210b, 0x210d, + 0x2110, 0x2112, + 0x2115, 0x2115, + 0x2119, 0x211d, + 0x2124, 0x2124, + 0x2126, 0x2126, + 0x2128, 0x2128, + 0x212a, 0x212d, + 0x2130, 0x2133, + 0x213e, 0x213f, + 0x2145, 0x2145, + 0x2160, 0x216f, + 0x2183, 0x2183, + 0x24b6, 0x24cf, + 0x2c00, 0x2c2e, + 0x2c60, 0x2c60, + 0x2c62, 0x2c64, + 0x2c67, 0x2c67, + 0x2c69, 0x2c69, + 0x2c6b, 0x2c6b, + 0x2c6d, 0x2c70, + 0x2c72, 0x2c72, + 0x2c75, 0x2c75, + 0x2c7e, 0x2c80, + 0x2c82, 0x2c82, + 0x2c84, 0x2c84, + 0x2c86, 0x2c86, + 0x2c88, 0x2c88, + 0x2c8a, 0x2c8a, + 0x2c8c, 0x2c8c, + 0x2c8e, 0x2c8e, + 0x2c90, 0x2c90, + 0x2c92, 0x2c92, + 0x2c94, 0x2c94, + 0x2c96, 0x2c96, + 0x2c98, 0x2c98, + 0x2c9a, 0x2c9a, + 0x2c9c, 0x2c9c, + 0x2c9e, 0x2c9e, + 0x2ca0, 0x2ca0, + 0x2ca2, 0x2ca2, + 0x2ca4, 0x2ca4, + 0x2ca6, 0x2ca6, + 0x2ca8, 0x2ca8, + 0x2caa, 0x2caa, + 0x2cac, 0x2cac, + 0x2cae, 0x2cae, + 0x2cb0, 0x2cb0, + 0x2cb2, 0x2cb2, + 0x2cb4, 0x2cb4, + 0x2cb6, 0x2cb6, + 0x2cb8, 0x2cb8, + 0x2cba, 0x2cba, + 0x2cbc, 0x2cbc, + 0x2cbe, 0x2cbe, + 0x2cc0, 0x2cc0, + 0x2cc2, 0x2cc2, + 0x2cc4, 0x2cc4, + 0x2cc6, 0x2cc6, + 0x2cc8, 0x2cc8, + 0x2cca, 0x2cca, + 0x2ccc, 0x2ccc, + 0x2cce, 0x2cce, + 0x2cd0, 0x2cd0, + 0x2cd2, 0x2cd2, + 0x2cd4, 0x2cd4, + 0x2cd6, 0x2cd6, + 0x2cd8, 0x2cd8, + 0x2cda, 0x2cda, + 0x2cdc, 0x2cdc, + 0x2cde, 0x2cde, + 0x2ce0, 0x2ce0, + 0x2ce2, 0x2ce2, + 0x2ceb, 0x2ceb, + 0x2ced, 0x2ced, + 0xa640, 0xa640, + 0xa642, 0xa642, + 0xa644, 0xa644, + 0xa646, 0xa646, + 0xa648, 0xa648, + 0xa64a, 0xa64a, + 0xa64c, 0xa64c, + 0xa64e, 0xa64e, + 0xa650, 0xa650, + 0xa652, 0xa652, + 0xa654, 0xa654, + 0xa656, 0xa656, + 0xa658, 0xa658, + 0xa65a, 0xa65a, + 0xa65c, 0xa65c, + 0xa65e, 0xa65e, + 0xa662, 0xa662, + 0xa664, 0xa664, + 0xa666, 0xa666, + 0xa668, 0xa668, + 0xa66a, 0xa66a, + 0xa66c, 0xa66c, + 0xa680, 0xa680, + 0xa682, 0xa682, + 0xa684, 0xa684, + 0xa686, 0xa686, + 0xa688, 0xa688, + 0xa68a, 0xa68a, + 0xa68c, 0xa68c, + 0xa68e, 0xa68e, + 0xa690, 0xa690, + 0xa692, 0xa692, + 0xa694, 0xa694, + 0xa696, 0xa696, + 0xa722, 0xa722, + 0xa724, 0xa724, + 0xa726, 0xa726, + 0xa728, 0xa728, + 0xa72a, 0xa72a, + 0xa72c, 0xa72c, + 0xa72e, 0xa72e, + 0xa732, 0xa732, + 0xa734, 0xa734, + 0xa736, 0xa736, + 0xa738, 0xa738, + 0xa73a, 0xa73a, + 0xa73c, 0xa73c, + 0xa73e, 0xa73e, + 0xa740, 0xa740, + 0xa742, 0xa742, + 0xa744, 0xa744, + 0xa746, 0xa746, + 0xa748, 0xa748, + 0xa74a, 0xa74a, + 0xa74c, 0xa74c, + 0xa74e, 0xa74e, + 0xa750, 0xa750, + 0xa752, 0xa752, + 0xa754, 0xa754, + 0xa756, 0xa756, + 0xa758, 0xa758, + 0xa75a, 0xa75a, + 0xa75c, 0xa75c, + 0xa75e, 0xa75e, + 0xa760, 0xa760, + 0xa762, 0xa762, + 0xa764, 0xa764, + 0xa766, 0xa766, + 0xa768, 0xa768, + 0xa76a, 0xa76a, + 0xa76c, 0xa76c, + 0xa76e, 0xa76e, + 0xa779, 0xa779, + 0xa77b, 0xa77b, + 0xa77d, 0xa77e, + 0xa780, 0xa780, + 0xa782, 0xa782, + 0xa784, 0xa784, + 0xa786, 0xa786, + 0xa78b, 0xa78b, + 0xff21, 0xff3a, + 0x10400, 0x10427, + 0x1d400, 0x1d419, + 0x1d434, 0x1d44d, + 0x1d468, 0x1d481, + 0x1d49c, 0x1d49c, + 0x1d49e, 0x1d49f, + 0x1d4a2, 0x1d4a2, + 0x1d4a5, 0x1d4a6, + 0x1d4a9, 0x1d4ac, + 0x1d4ae, 0x1d4b5, + 0x1d4d0, 0x1d4e9, + 0x1d504, 0x1d505, + 0x1d507, 0x1d50a, + 0x1d50d, 0x1d514, + 0x1d516, 0x1d51c, + 0x1d538, 0x1d539, + 0x1d53b, 0x1d53e, + 0x1d540, 0x1d544, + 0x1d546, 0x1d546, + 0x1d54a, 0x1d550, + 0x1d56c, 0x1d585, + 0x1d5a0, 0x1d5b9, + 0x1d5d4, 0x1d5ed, + 0x1d608, 0x1d621, + 0x1d63c, 0x1d655, + 0x1d670, 0x1d689, + 0x1d6a8, 0x1d6c0, + 0x1d6e2, 0x1d6fa, + 0x1d71c, 0x1d734, + 0x1d756, 0x1d76e, + 0x1d790, 0x1d7a8, + 0x1d7ca, 0x1d7ca, +}; /* CR_Uppercase */ + +/* 'Cased': Derived Property */ +static const OnigCodePoint CR_Cased[] = { + 110, + 0x0041, 0x005a, + 0x0061, 0x007a, + 0x00aa, 0x00aa, + 0x00b5, 0x00b5, + 0x00ba, 0x00ba, + 0x00c0, 0x00d6, + 0x00d8, 0x00f6, + 0x00f8, 0x01ba, + 0x01bc, 0x01bf, + 0x01c4, 0x0293, + 0x0295, 0x02b8, + 0x02c0, 0x02c1, + 0x02e0, 0x02e4, + 0x0345, 0x0345, + 0x0370, 0x0373, + 0x0376, 0x0377, + 0x037a, 0x037d, + 0x0386, 0x0386, + 0x0388, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x03a1, + 0x03a3, 0x03f5, + 0x03f7, 0x0481, + 0x048a, 0x0525, + 0x0531, 0x0556, + 0x0561, 0x0587, + 0x10a0, 0x10c5, + 0x1d00, 0x1dbf, + 0x1e00, 0x1f15, + 0x1f18, 0x1f1d, + 0x1f20, 0x1f45, + 0x1f48, 0x1f4d, + 0x1f50, 0x1f57, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f7d, + 0x1f80, 0x1fb4, + 0x1fb6, 0x1fbc, + 0x1fbe, 0x1fbe, + 0x1fc2, 0x1fc4, + 0x1fc6, 0x1fcc, + 0x1fd0, 0x1fd3, + 0x1fd6, 0x1fdb, + 0x1fe0, 0x1fec, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ffc, + 0x2090, 0x2094, + 0x2102, 0x2102, + 0x2107, 0x2107, + 0x210a, 0x2113, + 0x2115, 0x2115, + 0x2119, 0x211d, + 0x2124, 0x2124, + 0x2126, 0x2126, + 0x2128, 0x2128, + 0x212a, 0x212d, + 0x212f, 0x2134, + 0x2139, 0x2139, + 0x213c, 0x213f, + 0x2145, 0x2149, + 0x214e, 0x214e, + 0x2160, 0x217f, + 0x2183, 0x2184, + 0x24b6, 0x24e9, + 0x2c00, 0x2c2e, + 0x2c30, 0x2c5e, + 0x2c60, 0x2ce4, + 0x2ceb, 0x2cee, + 0x2d00, 0x2d25, + 0xa640, 0xa65f, + 0xa662, 0xa66d, + 0xa680, 0xa697, + 0xa722, 0xa787, + 0xa78b, 0xa78c, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xff21, 0xff3a, + 0xff41, 0xff5a, + 0x10400, 0x1044f, + 0x1d400, 0x1d454, + 0x1d456, 0x1d49c, + 0x1d49e, 0x1d49f, + 0x1d4a2, 0x1d4a2, + 0x1d4a5, 0x1d4a6, + 0x1d4a9, 0x1d4ac, + 0x1d4ae, 0x1d4b9, + 0x1d4bb, 0x1d4bb, + 0x1d4bd, 0x1d4c3, + 0x1d4c5, 0x1d505, + 0x1d507, 0x1d50a, + 0x1d50d, 0x1d514, + 0x1d516, 0x1d51c, + 0x1d51e, 0x1d539, + 0x1d53b, 0x1d53e, + 0x1d540, 0x1d544, + 0x1d546, 0x1d546, + 0x1d54a, 0x1d550, + 0x1d552, 0x1d6a5, + 0x1d6a8, 0x1d6c0, + 0x1d6c2, 0x1d6da, + 0x1d6dc, 0x1d6fa, + 0x1d6fc, 0x1d714, + 0x1d716, 0x1d734, + 0x1d736, 0x1d74e, + 0x1d750, 0x1d76e, + 0x1d770, 0x1d788, + 0x1d78a, 0x1d7a8, + 0x1d7aa, 0x1d7c2, + 0x1d7c4, 0x1d7cb, +}; /* CR_Cased */ + +/* 'Case_Ignorable': Derived Property */ +static const OnigCodePoint CR_Case_Ignorable[] = { + 266, + 0x0027, 0x0027, + 0x002e, 0x002e, + 0x003a, 0x003a, + 0x005e, 0x005e, + 0x0060, 0x0060, + 0x00a8, 0x00a8, + 0x00ad, 0x00ad, + 0x00af, 0x00af, + 0x00b4, 0x00b4, + 0x00b7, 0x00b8, + 0x02b0, 0x036f, + 0x0374, 0x0375, + 0x037a, 0x037a, + 0x0384, 0x0385, + 0x0387, 0x0387, + 0x0483, 0x0489, + 0x0559, 0x0559, + 0x0591, 0x05bd, + 0x05bf, 0x05bf, + 0x05c1, 0x05c2, + 0x05c4, 0x05c5, + 0x05c7, 0x05c7, + 0x05f4, 0x05f4, + 0x0600, 0x0603, + 0x0610, 0x061a, + 0x0640, 0x0640, + 0x064b, 0x065e, + 0x0670, 0x0670, + 0x06d6, 0x06e8, + 0x06ea, 0x06ed, + 0x070f, 0x070f, + 0x0711, 0x0711, + 0x0730, 0x074a, + 0x07a6, 0x07b0, + 0x07eb, 0x07f5, + 0x07fa, 0x07fa, + 0x0816, 0x082d, + 0x0900, 0x0902, + 0x093c, 0x093c, + 0x0941, 0x0948, + 0x094d, 0x094d, + 0x0951, 0x0955, + 0x0962, 0x0963, + 0x0971, 0x0971, + 0x0981, 0x0981, + 0x09bc, 0x09bc, + 0x09c1, 0x09c4, + 0x09cd, 0x09cd, + 0x09e2, 0x09e3, + 0x0a01, 0x0a02, + 0x0a3c, 0x0a3c, + 0x0a41, 0x0a42, + 0x0a47, 0x0a48, + 0x0a4b, 0x0a4d, + 0x0a51, 0x0a51, + 0x0a70, 0x0a71, + 0x0a75, 0x0a75, + 0x0a81, 0x0a82, + 0x0abc, 0x0abc, + 0x0ac1, 0x0ac5, + 0x0ac7, 0x0ac8, + 0x0acd, 0x0acd, + 0x0ae2, 0x0ae3, + 0x0b01, 0x0b01, + 0x0b3c, 0x0b3c, + 0x0b3f, 0x0b3f, + 0x0b41, 0x0b44, + 0x0b4d, 0x0b4d, + 0x0b56, 0x0b56, + 0x0b62, 0x0b63, + 0x0b82, 0x0b82, + 0x0bc0, 0x0bc0, + 0x0bcd, 0x0bcd, + 0x0c3e, 0x0c40, + 0x0c46, 0x0c48, + 0x0c4a, 0x0c4d, + 0x0c55, 0x0c56, + 0x0c62, 0x0c63, + 0x0cbc, 0x0cbc, + 0x0cbf, 0x0cbf, + 0x0cc6, 0x0cc6, + 0x0ccc, 0x0ccd, + 0x0ce2, 0x0ce3, + 0x0d41, 0x0d44, + 0x0d4d, 0x0d4d, + 0x0d62, 0x0d63, + 0x0dca, 0x0dca, + 0x0dd2, 0x0dd4, + 0x0dd6, 0x0dd6, + 0x0e31, 0x0e31, + 0x0e34, 0x0e3a, + 0x0e46, 0x0e4e, + 0x0eb1, 0x0eb1, + 0x0eb4, 0x0eb9, + 0x0ebb, 0x0ebc, + 0x0ec6, 0x0ec6, + 0x0ec8, 0x0ecd, + 0x0f18, 0x0f19, + 0x0f35, 0x0f35, + 0x0f37, 0x0f37, + 0x0f39, 0x0f39, + 0x0f71, 0x0f7e, + 0x0f80, 0x0f84, + 0x0f86, 0x0f87, + 0x0f90, 0x0f97, + 0x0f99, 0x0fbc, + 0x0fc6, 0x0fc6, + 0x102d, 0x1030, + 0x1032, 0x1037, + 0x1039, 0x103a, + 0x103d, 0x103e, + 0x1058, 0x1059, + 0x105e, 0x1060, + 0x1071, 0x1074, + 0x1082, 0x1082, + 0x1085, 0x1086, + 0x108d, 0x108d, + 0x109d, 0x109d, + 0x10fc, 0x10fc, + 0x135f, 0x135f, + 0x1712, 0x1714, + 0x1732, 0x1734, + 0x1752, 0x1753, + 0x1772, 0x1773, + 0x17b4, 0x17b5, + 0x17b7, 0x17bd, + 0x17c6, 0x17c6, + 0x17c9, 0x17d3, + 0x17d7, 0x17d7, + 0x17dd, 0x17dd, + 0x180b, 0x180d, + 0x1843, 0x1843, + 0x18a9, 0x18a9, + 0x1920, 0x1922, + 0x1927, 0x1928, + 0x1932, 0x1932, + 0x1939, 0x193b, + 0x1a17, 0x1a18, + 0x1a56, 0x1a56, + 0x1a58, 0x1a5e, + 0x1a60, 0x1a60, + 0x1a62, 0x1a62, + 0x1a65, 0x1a6c, + 0x1a73, 0x1a7c, + 0x1a7f, 0x1a7f, + 0x1aa7, 0x1aa7, + 0x1b00, 0x1b03, + 0x1b34, 0x1b34, + 0x1b36, 0x1b3a, + 0x1b3c, 0x1b3c, + 0x1b42, 0x1b42, + 0x1b6b, 0x1b73, + 0x1b80, 0x1b81, + 0x1ba2, 0x1ba5, + 0x1ba8, 0x1ba9, + 0x1c2c, 0x1c33, + 0x1c36, 0x1c37, + 0x1c78, 0x1c7d, + 0x1cd0, 0x1cd2, + 0x1cd4, 0x1ce0, + 0x1ce2, 0x1ce8, + 0x1ced, 0x1ced, + 0x1d2c, 0x1d61, + 0x1d78, 0x1d78, + 0x1d9b, 0x1de6, + 0x1dfd, 0x1dff, + 0x1fbd, 0x1fbd, + 0x1fbf, 0x1fc1, + 0x1fcd, 0x1fcf, + 0x1fdd, 0x1fdf, + 0x1fed, 0x1fef, + 0x1ffd, 0x1ffe, + 0x200b, 0x200f, + 0x2018, 0x2019, + 0x2024, 0x2024, + 0x2027, 0x2027, + 0x202a, 0x202e, + 0x2060, 0x2064, + 0x206a, 0x206f, + 0x2071, 0x2071, + 0x207f, 0x207f, + 0x2090, 0x2094, + 0x20d0, 0x20f0, + 0x2c7d, 0x2c7d, + 0x2cef, 0x2cf1, + 0x2d6f, 0x2d6f, + 0x2de0, 0x2dff, + 0x2e2f, 0x2e2f, + 0x3005, 0x3005, + 0x302a, 0x302f, + 0x3031, 0x3035, + 0x303b, 0x303b, + 0x3099, 0x309e, + 0x30fc, 0x30fe, + 0xa015, 0xa015, + 0xa4f8, 0xa4fd, + 0xa60c, 0xa60c, + 0xa66f, 0xa672, + 0xa67c, 0xa67d, + 0xa67f, 0xa67f, + 0xa6f0, 0xa6f1, + 0xa700, 0xa721, + 0xa770, 0xa770, + 0xa788, 0xa78a, + 0xa802, 0xa802, + 0xa806, 0xa806, + 0xa80b, 0xa80b, + 0xa825, 0xa826, + 0xa8c4, 0xa8c4, + 0xa8e0, 0xa8f1, + 0xa926, 0xa92d, + 0xa947, 0xa951, + 0xa980, 0xa982, + 0xa9b3, 0xa9b3, + 0xa9b6, 0xa9b9, + 0xa9bc, 0xa9bc, + 0xa9cf, 0xa9cf, + 0xaa29, 0xaa2e, + 0xaa31, 0xaa32, + 0xaa35, 0xaa36, + 0xaa43, 0xaa43, + 0xaa4c, 0xaa4c, + 0xaa70, 0xaa70, + 0xaab0, 0xaab0, + 0xaab2, 0xaab4, + 0xaab7, 0xaab8, + 0xaabe, 0xaabf, + 0xaac1, 0xaac1, + 0xaadd, 0xaadd, + 0xabe5, 0xabe5, + 0xabe8, 0xabe8, + 0xabed, 0xabed, + 0xfb1e, 0xfb1e, + 0xfe00, 0xfe0f, + 0xfe13, 0xfe13, + 0xfe20, 0xfe26, + 0xfe52, 0xfe52, + 0xfe55, 0xfe55, + 0xfeff, 0xfeff, + 0xff07, 0xff07, + 0xff0e, 0xff0e, + 0xff1a, 0xff1a, + 0xff3e, 0xff3e, + 0xff40, 0xff40, + 0xff70, 0xff70, + 0xff9e, 0xff9f, + 0xffe3, 0xffe3, + 0xfff9, 0xfffb, + 0x101fd, 0x101fd, + 0x10a01, 0x10a03, + 0x10a05, 0x10a06, + 0x10a0c, 0x10a0f, + 0x10a38, 0x10a3a, + 0x10a3f, 0x10a3f, + 0x11080, 0x11081, + 0x110b3, 0x110b6, + 0x110b9, 0x110ba, + 0x110bd, 0x110bd, + 0x1d167, 0x1d169, + 0x1d173, 0x1d182, + 0x1d185, 0x1d18b, + 0x1d1aa, 0x1d1ad, + 0x1d242, 0x1d244, + 0xe0001, 0xe0001, + 0xe0020, 0xe007f, + 0xe0100, 0xe01ef, +}; /* CR_Case_Ignorable */ + +/* 'Changes_When_Lowercased': Derived Property */ +static const OnigCodePoint CR_Changes_When_Lowercased[] = { + 557, + 0x0041, 0x005a, + 0x00c0, 0x00d6, + 0x00d8, 0x00de, + 0x0100, 0x0100, + 0x0102, 0x0102, + 0x0104, 0x0104, + 0x0106, 0x0106, + 0x0108, 0x0108, + 0x010a, 0x010a, + 0x010c, 0x010c, + 0x010e, 0x010e, + 0x0110, 0x0110, + 0x0112, 0x0112, + 0x0114, 0x0114, + 0x0116, 0x0116, + 0x0118, 0x0118, + 0x011a, 0x011a, + 0x011c, 0x011c, + 0x011e, 0x011e, + 0x0120, 0x0120, + 0x0122, 0x0122, + 0x0124, 0x0124, + 0x0126, 0x0126, + 0x0128, 0x0128, + 0x012a, 0x012a, + 0x012c, 0x012c, + 0x012e, 0x012e, + 0x0130, 0x0130, + 0x0132, 0x0132, + 0x0134, 0x0134, + 0x0136, 0x0136, + 0x0139, 0x0139, + 0x013b, 0x013b, + 0x013d, 0x013d, + 0x013f, 0x013f, + 0x0141, 0x0141, + 0x0143, 0x0143, + 0x0145, 0x0145, + 0x0147, 0x0147, + 0x014a, 0x014a, + 0x014c, 0x014c, + 0x014e, 0x014e, + 0x0150, 0x0150, + 0x0152, 0x0152, + 0x0154, 0x0154, + 0x0156, 0x0156, + 0x0158, 0x0158, + 0x015a, 0x015a, + 0x015c, 0x015c, + 0x015e, 0x015e, + 0x0160, 0x0160, + 0x0162, 0x0162, + 0x0164, 0x0164, + 0x0166, 0x0166, + 0x0168, 0x0168, + 0x016a, 0x016a, + 0x016c, 0x016c, + 0x016e, 0x016e, + 0x0170, 0x0170, + 0x0172, 0x0172, + 0x0174, 0x0174, + 0x0176, 0x0176, + 0x0178, 0x0179, + 0x017b, 0x017b, + 0x017d, 0x017d, + 0x0181, 0x0182, + 0x0184, 0x0184, + 0x0186, 0x0187, + 0x0189, 0x018b, + 0x018e, 0x0191, + 0x0193, 0x0194, + 0x0196, 0x0198, + 0x019c, 0x019d, + 0x019f, 0x01a0, + 0x01a2, 0x01a2, + 0x01a4, 0x01a4, + 0x01a6, 0x01a7, + 0x01a9, 0x01a9, + 0x01ac, 0x01ac, + 0x01ae, 0x01af, + 0x01b1, 0x01b3, + 0x01b5, 0x01b5, + 0x01b7, 0x01b8, + 0x01bc, 0x01bc, + 0x01c4, 0x01c5, + 0x01c7, 0x01c8, + 0x01ca, 0x01cb, + 0x01cd, 0x01cd, + 0x01cf, 0x01cf, + 0x01d1, 0x01d1, + 0x01d3, 0x01d3, + 0x01d5, 0x01d5, + 0x01d7, 0x01d7, + 0x01d9, 0x01d9, + 0x01db, 0x01db, + 0x01de, 0x01de, + 0x01e0, 0x01e0, + 0x01e2, 0x01e2, + 0x01e4, 0x01e4, + 0x01e6, 0x01e6, + 0x01e8, 0x01e8, + 0x01ea, 0x01ea, + 0x01ec, 0x01ec, + 0x01ee, 0x01ee, + 0x01f1, 0x01f2, + 0x01f4, 0x01f4, + 0x01f6, 0x01f8, + 0x01fa, 0x01fa, + 0x01fc, 0x01fc, + 0x01fe, 0x01fe, + 0x0200, 0x0200, + 0x0202, 0x0202, + 0x0204, 0x0204, + 0x0206, 0x0206, + 0x0208, 0x0208, + 0x020a, 0x020a, + 0x020c, 0x020c, + 0x020e, 0x020e, + 0x0210, 0x0210, + 0x0212, 0x0212, + 0x0214, 0x0214, + 0x0216, 0x0216, + 0x0218, 0x0218, + 0x021a, 0x021a, + 0x021c, 0x021c, + 0x021e, 0x021e, + 0x0220, 0x0220, + 0x0222, 0x0222, + 0x0224, 0x0224, + 0x0226, 0x0226, + 0x0228, 0x0228, + 0x022a, 0x022a, + 0x022c, 0x022c, + 0x022e, 0x022e, + 0x0230, 0x0230, + 0x0232, 0x0232, + 0x023a, 0x023b, + 0x023d, 0x023e, + 0x0241, 0x0241, + 0x0243, 0x0246, + 0x0248, 0x0248, + 0x024a, 0x024a, + 0x024c, 0x024c, + 0x024e, 0x024e, + 0x0370, 0x0370, + 0x0372, 0x0372, + 0x0376, 0x0376, + 0x0386, 0x0386, + 0x0388, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x038f, + 0x0391, 0x03a1, + 0x03a3, 0x03ab, + 0x03cf, 0x03cf, + 0x03d8, 0x03d8, + 0x03da, 0x03da, + 0x03dc, 0x03dc, + 0x03de, 0x03de, + 0x03e0, 0x03e0, + 0x03e2, 0x03e2, + 0x03e4, 0x03e4, + 0x03e6, 0x03e6, + 0x03e8, 0x03e8, + 0x03ea, 0x03ea, + 0x03ec, 0x03ec, + 0x03ee, 0x03ee, + 0x03f4, 0x03f4, + 0x03f7, 0x03f7, + 0x03f9, 0x03fa, + 0x03fd, 0x042f, + 0x0460, 0x0460, + 0x0462, 0x0462, + 0x0464, 0x0464, + 0x0466, 0x0466, + 0x0468, 0x0468, + 0x046a, 0x046a, + 0x046c, 0x046c, + 0x046e, 0x046e, + 0x0470, 0x0470, + 0x0472, 0x0472, + 0x0474, 0x0474, + 0x0476, 0x0476, + 0x0478, 0x0478, + 0x047a, 0x047a, + 0x047c, 0x047c, + 0x047e, 0x047e, + 0x0480, 0x0480, + 0x048a, 0x048a, + 0x048c, 0x048c, + 0x048e, 0x048e, + 0x0490, 0x0490, + 0x0492, 0x0492, + 0x0494, 0x0494, + 0x0496, 0x0496, + 0x0498, 0x0498, + 0x049a, 0x049a, + 0x049c, 0x049c, + 0x049e, 0x049e, + 0x04a0, 0x04a0, + 0x04a2, 0x04a2, + 0x04a4, 0x04a4, + 0x04a6, 0x04a6, + 0x04a8, 0x04a8, + 0x04aa, 0x04aa, + 0x04ac, 0x04ac, + 0x04ae, 0x04ae, + 0x04b0, 0x04b0, + 0x04b2, 0x04b2, + 0x04b4, 0x04b4, + 0x04b6, 0x04b6, + 0x04b8, 0x04b8, + 0x04ba, 0x04ba, + 0x04bc, 0x04bc, + 0x04be, 0x04be, + 0x04c0, 0x04c1, + 0x04c3, 0x04c3, + 0x04c5, 0x04c5, + 0x04c7, 0x04c7, + 0x04c9, 0x04c9, + 0x04cb, 0x04cb, + 0x04cd, 0x04cd, + 0x04d0, 0x04d0, + 0x04d2, 0x04d2, + 0x04d4, 0x04d4, + 0x04d6, 0x04d6, + 0x04d8, 0x04d8, + 0x04da, 0x04da, + 0x04dc, 0x04dc, + 0x04de, 0x04de, + 0x04e0, 0x04e0, + 0x04e2, 0x04e2, + 0x04e4, 0x04e4, + 0x04e6, 0x04e6, + 0x04e8, 0x04e8, + 0x04ea, 0x04ea, + 0x04ec, 0x04ec, + 0x04ee, 0x04ee, + 0x04f0, 0x04f0, + 0x04f2, 0x04f2, + 0x04f4, 0x04f4, + 0x04f6, 0x04f6, + 0x04f8, 0x04f8, + 0x04fa, 0x04fa, + 0x04fc, 0x04fc, + 0x04fe, 0x04fe, + 0x0500, 0x0500, + 0x0502, 0x0502, + 0x0504, 0x0504, + 0x0506, 0x0506, + 0x0508, 0x0508, + 0x050a, 0x050a, + 0x050c, 0x050c, + 0x050e, 0x050e, + 0x0510, 0x0510, + 0x0512, 0x0512, + 0x0514, 0x0514, + 0x0516, 0x0516, + 0x0518, 0x0518, + 0x051a, 0x051a, + 0x051c, 0x051c, + 0x051e, 0x051e, + 0x0520, 0x0520, + 0x0522, 0x0522, + 0x0524, 0x0524, + 0x0531, 0x0556, + 0x10a0, 0x10c5, + 0x1e00, 0x1e00, + 0x1e02, 0x1e02, + 0x1e04, 0x1e04, + 0x1e06, 0x1e06, + 0x1e08, 0x1e08, + 0x1e0a, 0x1e0a, + 0x1e0c, 0x1e0c, + 0x1e0e, 0x1e0e, + 0x1e10, 0x1e10, + 0x1e12, 0x1e12, + 0x1e14, 0x1e14, + 0x1e16, 0x1e16, + 0x1e18, 0x1e18, + 0x1e1a, 0x1e1a, + 0x1e1c, 0x1e1c, + 0x1e1e, 0x1e1e, + 0x1e20, 0x1e20, + 0x1e22, 0x1e22, + 0x1e24, 0x1e24, + 0x1e26, 0x1e26, + 0x1e28, 0x1e28, + 0x1e2a, 0x1e2a, + 0x1e2c, 0x1e2c, + 0x1e2e, 0x1e2e, + 0x1e30, 0x1e30, + 0x1e32, 0x1e32, + 0x1e34, 0x1e34, + 0x1e36, 0x1e36, + 0x1e38, 0x1e38, + 0x1e3a, 0x1e3a, + 0x1e3c, 0x1e3c, + 0x1e3e, 0x1e3e, + 0x1e40, 0x1e40, + 0x1e42, 0x1e42, + 0x1e44, 0x1e44, + 0x1e46, 0x1e46, + 0x1e48, 0x1e48, + 0x1e4a, 0x1e4a, + 0x1e4c, 0x1e4c, + 0x1e4e, 0x1e4e, + 0x1e50, 0x1e50, + 0x1e52, 0x1e52, + 0x1e54, 0x1e54, + 0x1e56, 0x1e56, + 0x1e58, 0x1e58, + 0x1e5a, 0x1e5a, + 0x1e5c, 0x1e5c, + 0x1e5e, 0x1e5e, + 0x1e60, 0x1e60, + 0x1e62, 0x1e62, + 0x1e64, 0x1e64, + 0x1e66, 0x1e66, + 0x1e68, 0x1e68, + 0x1e6a, 0x1e6a, + 0x1e6c, 0x1e6c, + 0x1e6e, 0x1e6e, + 0x1e70, 0x1e70, + 0x1e72, 0x1e72, + 0x1e74, 0x1e74, + 0x1e76, 0x1e76, + 0x1e78, 0x1e78, + 0x1e7a, 0x1e7a, + 0x1e7c, 0x1e7c, + 0x1e7e, 0x1e7e, + 0x1e80, 0x1e80, + 0x1e82, 0x1e82, + 0x1e84, 0x1e84, + 0x1e86, 0x1e86, + 0x1e88, 0x1e88, + 0x1e8a, 0x1e8a, + 0x1e8c, 0x1e8c, + 0x1e8e, 0x1e8e, + 0x1e90, 0x1e90, + 0x1e92, 0x1e92, + 0x1e94, 0x1e94, + 0x1e9e, 0x1e9e, + 0x1ea0, 0x1ea0, + 0x1ea2, 0x1ea2, + 0x1ea4, 0x1ea4, + 0x1ea6, 0x1ea6, + 0x1ea8, 0x1ea8, + 0x1eaa, 0x1eaa, + 0x1eac, 0x1eac, + 0x1eae, 0x1eae, + 0x1eb0, 0x1eb0, + 0x1eb2, 0x1eb2, + 0x1eb4, 0x1eb4, + 0x1eb6, 0x1eb6, + 0x1eb8, 0x1eb8, + 0x1eba, 0x1eba, + 0x1ebc, 0x1ebc, + 0x1ebe, 0x1ebe, + 0x1ec0, 0x1ec0, + 0x1ec2, 0x1ec2, + 0x1ec4, 0x1ec4, + 0x1ec6, 0x1ec6, + 0x1ec8, 0x1ec8, + 0x1eca, 0x1eca, + 0x1ecc, 0x1ecc, + 0x1ece, 0x1ece, + 0x1ed0, 0x1ed0, + 0x1ed2, 0x1ed2, + 0x1ed4, 0x1ed4, + 0x1ed6, 0x1ed6, + 0x1ed8, 0x1ed8, + 0x1eda, 0x1eda, + 0x1edc, 0x1edc, + 0x1ede, 0x1ede, + 0x1ee0, 0x1ee0, + 0x1ee2, 0x1ee2, + 0x1ee4, 0x1ee4, + 0x1ee6, 0x1ee6, + 0x1ee8, 0x1ee8, + 0x1eea, 0x1eea, + 0x1eec, 0x1eec, + 0x1eee, 0x1eee, + 0x1ef0, 0x1ef0, + 0x1ef2, 0x1ef2, + 0x1ef4, 0x1ef4, + 0x1ef6, 0x1ef6, + 0x1ef8, 0x1ef8, + 0x1efa, 0x1efa, + 0x1efc, 0x1efc, + 0x1efe, 0x1efe, + 0x1f08, 0x1f0f, + 0x1f18, 0x1f1d, + 0x1f28, 0x1f2f, + 0x1f38, 0x1f3f, + 0x1f48, 0x1f4d, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f5f, + 0x1f68, 0x1f6f, + 0x1f88, 0x1f8f, + 0x1f98, 0x1f9f, + 0x1fa8, 0x1faf, + 0x1fb8, 0x1fbc, + 0x1fc8, 0x1fcc, + 0x1fd8, 0x1fdb, + 0x1fe8, 0x1fec, + 0x1ff8, 0x1ffc, + 0x2126, 0x2126, + 0x212a, 0x212b, + 0x2132, 0x2132, + 0x2160, 0x216f, + 0x2183, 0x2183, + 0x24b6, 0x24cf, + 0x2c00, 0x2c2e, + 0x2c60, 0x2c60, + 0x2c62, 0x2c64, + 0x2c67, 0x2c67, + 0x2c69, 0x2c69, + 0x2c6b, 0x2c6b, + 0x2c6d, 0x2c70, + 0x2c72, 0x2c72, + 0x2c75, 0x2c75, + 0x2c7e, 0x2c80, + 0x2c82, 0x2c82, + 0x2c84, 0x2c84, + 0x2c86, 0x2c86, + 0x2c88, 0x2c88, + 0x2c8a, 0x2c8a, + 0x2c8c, 0x2c8c, + 0x2c8e, 0x2c8e, + 0x2c90, 0x2c90, + 0x2c92, 0x2c92, + 0x2c94, 0x2c94, + 0x2c96, 0x2c96, + 0x2c98, 0x2c98, + 0x2c9a, 0x2c9a, + 0x2c9c, 0x2c9c, + 0x2c9e, 0x2c9e, + 0x2ca0, 0x2ca0, + 0x2ca2, 0x2ca2, + 0x2ca4, 0x2ca4, + 0x2ca6, 0x2ca6, + 0x2ca8, 0x2ca8, + 0x2caa, 0x2caa, + 0x2cac, 0x2cac, + 0x2cae, 0x2cae, + 0x2cb0, 0x2cb0, + 0x2cb2, 0x2cb2, + 0x2cb4, 0x2cb4, + 0x2cb6, 0x2cb6, + 0x2cb8, 0x2cb8, + 0x2cba, 0x2cba, + 0x2cbc, 0x2cbc, + 0x2cbe, 0x2cbe, + 0x2cc0, 0x2cc0, + 0x2cc2, 0x2cc2, + 0x2cc4, 0x2cc4, + 0x2cc6, 0x2cc6, + 0x2cc8, 0x2cc8, + 0x2cca, 0x2cca, + 0x2ccc, 0x2ccc, + 0x2cce, 0x2cce, + 0x2cd0, 0x2cd0, + 0x2cd2, 0x2cd2, + 0x2cd4, 0x2cd4, + 0x2cd6, 0x2cd6, + 0x2cd8, 0x2cd8, + 0x2cda, 0x2cda, + 0x2cdc, 0x2cdc, + 0x2cde, 0x2cde, + 0x2ce0, 0x2ce0, + 0x2ce2, 0x2ce2, + 0x2ceb, 0x2ceb, + 0x2ced, 0x2ced, + 0xa640, 0xa640, + 0xa642, 0xa642, + 0xa644, 0xa644, + 0xa646, 0xa646, + 0xa648, 0xa648, + 0xa64a, 0xa64a, + 0xa64c, 0xa64c, + 0xa64e, 0xa64e, + 0xa650, 0xa650, + 0xa652, 0xa652, + 0xa654, 0xa654, + 0xa656, 0xa656, + 0xa658, 0xa658, + 0xa65a, 0xa65a, + 0xa65c, 0xa65c, + 0xa65e, 0xa65e, + 0xa662, 0xa662, + 0xa664, 0xa664, + 0xa666, 0xa666, + 0xa668, 0xa668, + 0xa66a, 0xa66a, + 0xa66c, 0xa66c, + 0xa680, 0xa680, + 0xa682, 0xa682, + 0xa684, 0xa684, + 0xa686, 0xa686, + 0xa688, 0xa688, + 0xa68a, 0xa68a, + 0xa68c, 0xa68c, + 0xa68e, 0xa68e, + 0xa690, 0xa690, + 0xa692, 0xa692, + 0xa694, 0xa694, + 0xa696, 0xa696, + 0xa722, 0xa722, + 0xa724, 0xa724, + 0xa726, 0xa726, + 0xa728, 0xa728, + 0xa72a, 0xa72a, + 0xa72c, 0xa72c, + 0xa72e, 0xa72e, + 0xa732, 0xa732, + 0xa734, 0xa734, + 0xa736, 0xa736, + 0xa738, 0xa738, + 0xa73a, 0xa73a, + 0xa73c, 0xa73c, + 0xa73e, 0xa73e, + 0xa740, 0xa740, + 0xa742, 0xa742, + 0xa744, 0xa744, + 0xa746, 0xa746, + 0xa748, 0xa748, + 0xa74a, 0xa74a, + 0xa74c, 0xa74c, + 0xa74e, 0xa74e, + 0xa750, 0xa750, + 0xa752, 0xa752, + 0xa754, 0xa754, + 0xa756, 0xa756, + 0xa758, 0xa758, + 0xa75a, 0xa75a, + 0xa75c, 0xa75c, + 0xa75e, 0xa75e, + 0xa760, 0xa760, + 0xa762, 0xa762, + 0xa764, 0xa764, + 0xa766, 0xa766, + 0xa768, 0xa768, + 0xa76a, 0xa76a, + 0xa76c, 0xa76c, + 0xa76e, 0xa76e, + 0xa779, 0xa779, + 0xa77b, 0xa77b, + 0xa77d, 0xa77e, + 0xa780, 0xa780, + 0xa782, 0xa782, + 0xa784, 0xa784, + 0xa786, 0xa786, + 0xa78b, 0xa78b, + 0xff21, 0xff3a, + 0x10400, 0x10427, +}; /* CR_Changes_When_Lowercased */ + +/* 'Changes_When_Uppercased': Derived Property */ +static const OnigCodePoint CR_Changes_When_Uppercased[] = { + 573, + 0x0061, 0x007a, + 0x00b5, 0x00b5, + 0x00df, 0x00f6, + 0x00f8, 0x00ff, + 0x0101, 0x0101, + 0x0103, 0x0103, + 0x0105, 0x0105, + 0x0107, 0x0107, + 0x0109, 0x0109, + 0x010b, 0x010b, + 0x010d, 0x010d, + 0x010f, 0x010f, + 0x0111, 0x0111, + 0x0113, 0x0113, + 0x0115, 0x0115, + 0x0117, 0x0117, + 0x0119, 0x0119, + 0x011b, 0x011b, + 0x011d, 0x011d, + 0x011f, 0x011f, + 0x0121, 0x0121, + 0x0123, 0x0123, + 0x0125, 0x0125, + 0x0127, 0x0127, + 0x0129, 0x0129, + 0x012b, 0x012b, + 0x012d, 0x012d, + 0x012f, 0x012f, + 0x0131, 0x0131, + 0x0133, 0x0133, + 0x0135, 0x0135, + 0x0137, 0x0137, + 0x013a, 0x013a, + 0x013c, 0x013c, + 0x013e, 0x013e, + 0x0140, 0x0140, + 0x0142, 0x0142, + 0x0144, 0x0144, + 0x0146, 0x0146, + 0x0148, 0x0149, + 0x014b, 0x014b, + 0x014d, 0x014d, + 0x014f, 0x014f, + 0x0151, 0x0151, + 0x0153, 0x0153, + 0x0155, 0x0155, + 0x0157, 0x0157, + 0x0159, 0x0159, + 0x015b, 0x015b, + 0x015d, 0x015d, + 0x015f, 0x015f, + 0x0161, 0x0161, + 0x0163, 0x0163, + 0x0165, 0x0165, + 0x0167, 0x0167, + 0x0169, 0x0169, + 0x016b, 0x016b, + 0x016d, 0x016d, + 0x016f, 0x016f, + 0x0171, 0x0171, + 0x0173, 0x0173, + 0x0175, 0x0175, + 0x0177, 0x0177, + 0x017a, 0x017a, + 0x017c, 0x017c, + 0x017e, 0x0180, + 0x0183, 0x0183, + 0x0185, 0x0185, + 0x0188, 0x0188, + 0x018c, 0x018c, + 0x0192, 0x0192, + 0x0195, 0x0195, + 0x0199, 0x019a, + 0x019e, 0x019e, + 0x01a1, 0x01a1, + 0x01a3, 0x01a3, + 0x01a5, 0x01a5, + 0x01a8, 0x01a8, + 0x01ad, 0x01ad, + 0x01b0, 0x01b0, + 0x01b4, 0x01b4, + 0x01b6, 0x01b6, + 0x01b9, 0x01b9, + 0x01bd, 0x01bd, + 0x01bf, 0x01bf, + 0x01c5, 0x01c6, + 0x01c8, 0x01c9, + 0x01cb, 0x01cc, + 0x01ce, 0x01ce, + 0x01d0, 0x01d0, + 0x01d2, 0x01d2, + 0x01d4, 0x01d4, + 0x01d6, 0x01d6, + 0x01d8, 0x01d8, + 0x01da, 0x01da, + 0x01dc, 0x01dd, + 0x01df, 0x01df, + 0x01e1, 0x01e1, + 0x01e3, 0x01e3, + 0x01e5, 0x01e5, + 0x01e7, 0x01e7, + 0x01e9, 0x01e9, + 0x01eb, 0x01eb, + 0x01ed, 0x01ed, + 0x01ef, 0x01f0, + 0x01f2, 0x01f3, + 0x01f5, 0x01f5, + 0x01f9, 0x01f9, + 0x01fb, 0x01fb, + 0x01fd, 0x01fd, + 0x01ff, 0x01ff, + 0x0201, 0x0201, + 0x0203, 0x0203, + 0x0205, 0x0205, + 0x0207, 0x0207, + 0x0209, 0x0209, + 0x020b, 0x020b, + 0x020d, 0x020d, + 0x020f, 0x020f, + 0x0211, 0x0211, + 0x0213, 0x0213, + 0x0215, 0x0215, + 0x0217, 0x0217, + 0x0219, 0x0219, + 0x021b, 0x021b, + 0x021d, 0x021d, + 0x021f, 0x021f, + 0x0223, 0x0223, + 0x0225, 0x0225, + 0x0227, 0x0227, + 0x0229, 0x0229, + 0x022b, 0x022b, + 0x022d, 0x022d, + 0x022f, 0x022f, + 0x0231, 0x0231, + 0x0233, 0x0233, + 0x023c, 0x023c, + 0x023f, 0x0240, + 0x0242, 0x0242, + 0x0247, 0x0247, + 0x0249, 0x0249, + 0x024b, 0x024b, + 0x024d, 0x024d, + 0x024f, 0x0254, + 0x0256, 0x0257, + 0x0259, 0x0259, + 0x025b, 0x025b, + 0x0260, 0x0260, + 0x0263, 0x0263, + 0x0268, 0x0269, + 0x026b, 0x026b, + 0x026f, 0x026f, + 0x0271, 0x0272, + 0x0275, 0x0275, + 0x027d, 0x027d, + 0x0280, 0x0280, + 0x0283, 0x0283, + 0x0288, 0x028c, + 0x0292, 0x0292, + 0x0345, 0x0345, + 0x0371, 0x0371, + 0x0373, 0x0373, + 0x0377, 0x0377, + 0x037b, 0x037d, + 0x0390, 0x0390, + 0x03ac, 0x03ce, + 0x03d0, 0x03d1, + 0x03d5, 0x03d7, + 0x03d9, 0x03d9, + 0x03db, 0x03db, + 0x03dd, 0x03dd, + 0x03df, 0x03df, + 0x03e1, 0x03e1, + 0x03e3, 0x03e3, + 0x03e5, 0x03e5, + 0x03e7, 0x03e7, + 0x03e9, 0x03e9, + 0x03eb, 0x03eb, + 0x03ed, 0x03ed, + 0x03ef, 0x03f2, + 0x03f5, 0x03f5, + 0x03f8, 0x03f8, + 0x03fb, 0x03fb, + 0x0430, 0x045f, + 0x0461, 0x0461, + 0x0463, 0x0463, + 0x0465, 0x0465, + 0x0467, 0x0467, + 0x0469, 0x0469, + 0x046b, 0x046b, + 0x046d, 0x046d, + 0x046f, 0x046f, + 0x0471, 0x0471, + 0x0473, 0x0473, + 0x0475, 0x0475, + 0x0477, 0x0477, + 0x0479, 0x0479, + 0x047b, 0x047b, + 0x047d, 0x047d, + 0x047f, 0x047f, + 0x0481, 0x0481, + 0x048b, 0x048b, + 0x048d, 0x048d, + 0x048f, 0x048f, + 0x0491, 0x0491, + 0x0493, 0x0493, + 0x0495, 0x0495, + 0x0497, 0x0497, + 0x0499, 0x0499, + 0x049b, 0x049b, + 0x049d, 0x049d, + 0x049f, 0x049f, + 0x04a1, 0x04a1, + 0x04a3, 0x04a3, + 0x04a5, 0x04a5, + 0x04a7, 0x04a7, + 0x04a9, 0x04a9, + 0x04ab, 0x04ab, + 0x04ad, 0x04ad, + 0x04af, 0x04af, + 0x04b1, 0x04b1, + 0x04b3, 0x04b3, + 0x04b5, 0x04b5, + 0x04b7, 0x04b7, + 0x04b9, 0x04b9, + 0x04bb, 0x04bb, + 0x04bd, 0x04bd, + 0x04bf, 0x04bf, + 0x04c2, 0x04c2, + 0x04c4, 0x04c4, + 0x04c6, 0x04c6, + 0x04c8, 0x04c8, + 0x04ca, 0x04ca, + 0x04cc, 0x04cc, + 0x04ce, 0x04cf, + 0x04d1, 0x04d1, + 0x04d3, 0x04d3, + 0x04d5, 0x04d5, + 0x04d7, 0x04d7, + 0x04d9, 0x04d9, + 0x04db, 0x04db, + 0x04dd, 0x04dd, + 0x04df, 0x04df, + 0x04e1, 0x04e1, + 0x04e3, 0x04e3, + 0x04e5, 0x04e5, + 0x04e7, 0x04e7, + 0x04e9, 0x04e9, + 0x04eb, 0x04eb, + 0x04ed, 0x04ed, + 0x04ef, 0x04ef, + 0x04f1, 0x04f1, + 0x04f3, 0x04f3, + 0x04f5, 0x04f5, + 0x04f7, 0x04f7, + 0x04f9, 0x04f9, + 0x04fb, 0x04fb, + 0x04fd, 0x04fd, + 0x04ff, 0x04ff, + 0x0501, 0x0501, + 0x0503, 0x0503, + 0x0505, 0x0505, + 0x0507, 0x0507, + 0x0509, 0x0509, + 0x050b, 0x050b, + 0x050d, 0x050d, + 0x050f, 0x050f, + 0x0511, 0x0511, + 0x0513, 0x0513, + 0x0515, 0x0515, + 0x0517, 0x0517, + 0x0519, 0x0519, + 0x051b, 0x051b, + 0x051d, 0x051d, + 0x051f, 0x051f, + 0x0521, 0x0521, + 0x0523, 0x0523, + 0x0525, 0x0525, + 0x0561, 0x0587, + 0x1d79, 0x1d79, + 0x1d7d, 0x1d7d, + 0x1e01, 0x1e01, + 0x1e03, 0x1e03, + 0x1e05, 0x1e05, + 0x1e07, 0x1e07, + 0x1e09, 0x1e09, + 0x1e0b, 0x1e0b, + 0x1e0d, 0x1e0d, + 0x1e0f, 0x1e0f, + 0x1e11, 0x1e11, + 0x1e13, 0x1e13, + 0x1e15, 0x1e15, + 0x1e17, 0x1e17, + 0x1e19, 0x1e19, + 0x1e1b, 0x1e1b, + 0x1e1d, 0x1e1d, + 0x1e1f, 0x1e1f, + 0x1e21, 0x1e21, + 0x1e23, 0x1e23, + 0x1e25, 0x1e25, + 0x1e27, 0x1e27, + 0x1e29, 0x1e29, + 0x1e2b, 0x1e2b, + 0x1e2d, 0x1e2d, + 0x1e2f, 0x1e2f, + 0x1e31, 0x1e31, + 0x1e33, 0x1e33, + 0x1e35, 0x1e35, + 0x1e37, 0x1e37, + 0x1e39, 0x1e39, + 0x1e3b, 0x1e3b, + 0x1e3d, 0x1e3d, + 0x1e3f, 0x1e3f, + 0x1e41, 0x1e41, + 0x1e43, 0x1e43, + 0x1e45, 0x1e45, + 0x1e47, 0x1e47, + 0x1e49, 0x1e49, + 0x1e4b, 0x1e4b, + 0x1e4d, 0x1e4d, + 0x1e4f, 0x1e4f, + 0x1e51, 0x1e51, + 0x1e53, 0x1e53, + 0x1e55, 0x1e55, + 0x1e57, 0x1e57, + 0x1e59, 0x1e59, + 0x1e5b, 0x1e5b, + 0x1e5d, 0x1e5d, + 0x1e5f, 0x1e5f, + 0x1e61, 0x1e61, + 0x1e63, 0x1e63, + 0x1e65, 0x1e65, + 0x1e67, 0x1e67, + 0x1e69, 0x1e69, + 0x1e6b, 0x1e6b, + 0x1e6d, 0x1e6d, + 0x1e6f, 0x1e6f, + 0x1e71, 0x1e71, + 0x1e73, 0x1e73, + 0x1e75, 0x1e75, + 0x1e77, 0x1e77, + 0x1e79, 0x1e79, + 0x1e7b, 0x1e7b, + 0x1e7d, 0x1e7d, + 0x1e7f, 0x1e7f, + 0x1e81, 0x1e81, + 0x1e83, 0x1e83, + 0x1e85, 0x1e85, + 0x1e87, 0x1e87, + 0x1e89, 0x1e89, + 0x1e8b, 0x1e8b, + 0x1e8d, 0x1e8d, + 0x1e8f, 0x1e8f, + 0x1e91, 0x1e91, + 0x1e93, 0x1e93, + 0x1e95, 0x1e9b, + 0x1ea1, 0x1ea1, + 0x1ea3, 0x1ea3, + 0x1ea5, 0x1ea5, + 0x1ea7, 0x1ea7, + 0x1ea9, 0x1ea9, + 0x1eab, 0x1eab, + 0x1ead, 0x1ead, + 0x1eaf, 0x1eaf, + 0x1eb1, 0x1eb1, + 0x1eb3, 0x1eb3, + 0x1eb5, 0x1eb5, + 0x1eb7, 0x1eb7, + 0x1eb9, 0x1eb9, + 0x1ebb, 0x1ebb, + 0x1ebd, 0x1ebd, + 0x1ebf, 0x1ebf, + 0x1ec1, 0x1ec1, + 0x1ec3, 0x1ec3, + 0x1ec5, 0x1ec5, + 0x1ec7, 0x1ec7, + 0x1ec9, 0x1ec9, + 0x1ecb, 0x1ecb, + 0x1ecd, 0x1ecd, + 0x1ecf, 0x1ecf, + 0x1ed1, 0x1ed1, + 0x1ed3, 0x1ed3, + 0x1ed5, 0x1ed5, + 0x1ed7, 0x1ed7, + 0x1ed9, 0x1ed9, + 0x1edb, 0x1edb, + 0x1edd, 0x1edd, + 0x1edf, 0x1edf, + 0x1ee1, 0x1ee1, + 0x1ee3, 0x1ee3, + 0x1ee5, 0x1ee5, + 0x1ee7, 0x1ee7, + 0x1ee9, 0x1ee9, + 0x1eeb, 0x1eeb, + 0x1eed, 0x1eed, + 0x1eef, 0x1eef, + 0x1ef1, 0x1ef1, + 0x1ef3, 0x1ef3, + 0x1ef5, 0x1ef5, + 0x1ef7, 0x1ef7, + 0x1ef9, 0x1ef9, + 0x1efb, 0x1efb, + 0x1efd, 0x1efd, + 0x1eff, 0x1f07, + 0x1f10, 0x1f15, + 0x1f20, 0x1f27, + 0x1f30, 0x1f37, + 0x1f40, 0x1f45, + 0x1f50, 0x1f57, + 0x1f60, 0x1f67, + 0x1f70, 0x1f7d, + 0x1f80, 0x1fb4, + 0x1fb6, 0x1fb7, + 0x1fbc, 0x1fbc, + 0x1fbe, 0x1fbe, + 0x1fc2, 0x1fc4, + 0x1fc6, 0x1fc7, + 0x1fcc, 0x1fcc, + 0x1fd0, 0x1fd3, + 0x1fd6, 0x1fd7, + 0x1fe0, 0x1fe7, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ff7, + 0x1ffc, 0x1ffc, + 0x214e, 0x214e, + 0x2170, 0x217f, + 0x2184, 0x2184, + 0x24d0, 0x24e9, + 0x2c30, 0x2c5e, + 0x2c61, 0x2c61, + 0x2c65, 0x2c66, + 0x2c68, 0x2c68, + 0x2c6a, 0x2c6a, + 0x2c6c, 0x2c6c, + 0x2c73, 0x2c73, + 0x2c76, 0x2c76, + 0x2c81, 0x2c81, + 0x2c83, 0x2c83, + 0x2c85, 0x2c85, + 0x2c87, 0x2c87, + 0x2c89, 0x2c89, + 0x2c8b, 0x2c8b, + 0x2c8d, 0x2c8d, + 0x2c8f, 0x2c8f, + 0x2c91, 0x2c91, + 0x2c93, 0x2c93, + 0x2c95, 0x2c95, + 0x2c97, 0x2c97, + 0x2c99, 0x2c99, + 0x2c9b, 0x2c9b, + 0x2c9d, 0x2c9d, + 0x2c9f, 0x2c9f, + 0x2ca1, 0x2ca1, + 0x2ca3, 0x2ca3, + 0x2ca5, 0x2ca5, + 0x2ca7, 0x2ca7, + 0x2ca9, 0x2ca9, + 0x2cab, 0x2cab, + 0x2cad, 0x2cad, + 0x2caf, 0x2caf, + 0x2cb1, 0x2cb1, + 0x2cb3, 0x2cb3, + 0x2cb5, 0x2cb5, + 0x2cb7, 0x2cb7, + 0x2cb9, 0x2cb9, + 0x2cbb, 0x2cbb, + 0x2cbd, 0x2cbd, + 0x2cbf, 0x2cbf, + 0x2cc1, 0x2cc1, + 0x2cc3, 0x2cc3, + 0x2cc5, 0x2cc5, + 0x2cc7, 0x2cc7, + 0x2cc9, 0x2cc9, + 0x2ccb, 0x2ccb, + 0x2ccd, 0x2ccd, + 0x2ccf, 0x2ccf, + 0x2cd1, 0x2cd1, + 0x2cd3, 0x2cd3, + 0x2cd5, 0x2cd5, + 0x2cd7, 0x2cd7, + 0x2cd9, 0x2cd9, + 0x2cdb, 0x2cdb, + 0x2cdd, 0x2cdd, + 0x2cdf, 0x2cdf, + 0x2ce1, 0x2ce1, + 0x2ce3, 0x2ce3, + 0x2cec, 0x2cec, + 0x2cee, 0x2cee, + 0x2d00, 0x2d25, + 0xa641, 0xa641, + 0xa643, 0xa643, + 0xa645, 0xa645, + 0xa647, 0xa647, + 0xa649, 0xa649, + 0xa64b, 0xa64b, + 0xa64d, 0xa64d, + 0xa64f, 0xa64f, + 0xa651, 0xa651, + 0xa653, 0xa653, + 0xa655, 0xa655, + 0xa657, 0xa657, + 0xa659, 0xa659, + 0xa65b, 0xa65b, + 0xa65d, 0xa65d, + 0xa65f, 0xa65f, + 0xa663, 0xa663, + 0xa665, 0xa665, + 0xa667, 0xa667, + 0xa669, 0xa669, + 0xa66b, 0xa66b, + 0xa66d, 0xa66d, + 0xa681, 0xa681, + 0xa683, 0xa683, + 0xa685, 0xa685, + 0xa687, 0xa687, + 0xa689, 0xa689, + 0xa68b, 0xa68b, + 0xa68d, 0xa68d, + 0xa68f, 0xa68f, + 0xa691, 0xa691, + 0xa693, 0xa693, + 0xa695, 0xa695, + 0xa697, 0xa697, + 0xa723, 0xa723, + 0xa725, 0xa725, + 0xa727, 0xa727, + 0xa729, 0xa729, + 0xa72b, 0xa72b, + 0xa72d, 0xa72d, + 0xa72f, 0xa72f, + 0xa733, 0xa733, + 0xa735, 0xa735, + 0xa737, 0xa737, + 0xa739, 0xa739, + 0xa73b, 0xa73b, + 0xa73d, 0xa73d, + 0xa73f, 0xa73f, + 0xa741, 0xa741, + 0xa743, 0xa743, + 0xa745, 0xa745, + 0xa747, 0xa747, + 0xa749, 0xa749, + 0xa74b, 0xa74b, + 0xa74d, 0xa74d, + 0xa74f, 0xa74f, + 0xa751, 0xa751, + 0xa753, 0xa753, + 0xa755, 0xa755, + 0xa757, 0xa757, + 0xa759, 0xa759, + 0xa75b, 0xa75b, + 0xa75d, 0xa75d, + 0xa75f, 0xa75f, + 0xa761, 0xa761, + 0xa763, 0xa763, + 0xa765, 0xa765, + 0xa767, 0xa767, + 0xa769, 0xa769, + 0xa76b, 0xa76b, + 0xa76d, 0xa76d, + 0xa76f, 0xa76f, + 0xa77a, 0xa77a, + 0xa77c, 0xa77c, + 0xa77f, 0xa77f, + 0xa781, 0xa781, + 0xa783, 0xa783, + 0xa785, 0xa785, + 0xa787, 0xa787, + 0xa78c, 0xa78c, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xff41, 0xff5a, + 0x10428, 0x1044f, +}; /* CR_Changes_When_Uppercased */ + +/* 'Changes_When_Titlecased': Derived Property */ +static const OnigCodePoint CR_Changes_When_Titlecased[] = { + 574, + 0x0061, 0x007a, + 0x00b5, 0x00b5, + 0x00df, 0x00f6, + 0x00f8, 0x00ff, + 0x0101, 0x0101, + 0x0103, 0x0103, + 0x0105, 0x0105, + 0x0107, 0x0107, + 0x0109, 0x0109, + 0x010b, 0x010b, + 0x010d, 0x010d, + 0x010f, 0x010f, + 0x0111, 0x0111, + 0x0113, 0x0113, + 0x0115, 0x0115, + 0x0117, 0x0117, + 0x0119, 0x0119, + 0x011b, 0x011b, + 0x011d, 0x011d, + 0x011f, 0x011f, + 0x0121, 0x0121, + 0x0123, 0x0123, + 0x0125, 0x0125, + 0x0127, 0x0127, + 0x0129, 0x0129, + 0x012b, 0x012b, + 0x012d, 0x012d, + 0x012f, 0x012f, + 0x0131, 0x0131, + 0x0133, 0x0133, + 0x0135, 0x0135, + 0x0137, 0x0137, + 0x013a, 0x013a, + 0x013c, 0x013c, + 0x013e, 0x013e, + 0x0140, 0x0140, + 0x0142, 0x0142, + 0x0144, 0x0144, + 0x0146, 0x0146, + 0x0148, 0x0149, + 0x014b, 0x014b, + 0x014d, 0x014d, + 0x014f, 0x014f, + 0x0151, 0x0151, + 0x0153, 0x0153, + 0x0155, 0x0155, + 0x0157, 0x0157, + 0x0159, 0x0159, + 0x015b, 0x015b, + 0x015d, 0x015d, + 0x015f, 0x015f, + 0x0161, 0x0161, + 0x0163, 0x0163, + 0x0165, 0x0165, + 0x0167, 0x0167, + 0x0169, 0x0169, + 0x016b, 0x016b, + 0x016d, 0x016d, + 0x016f, 0x016f, + 0x0171, 0x0171, + 0x0173, 0x0173, + 0x0175, 0x0175, + 0x0177, 0x0177, + 0x017a, 0x017a, + 0x017c, 0x017c, + 0x017e, 0x0180, + 0x0183, 0x0183, + 0x0185, 0x0185, + 0x0188, 0x0188, + 0x018c, 0x018c, + 0x0192, 0x0192, + 0x0195, 0x0195, + 0x0199, 0x019a, + 0x019e, 0x019e, + 0x01a1, 0x01a1, + 0x01a3, 0x01a3, + 0x01a5, 0x01a5, + 0x01a8, 0x01a8, + 0x01ad, 0x01ad, + 0x01b0, 0x01b0, + 0x01b4, 0x01b4, + 0x01b6, 0x01b6, + 0x01b9, 0x01b9, + 0x01bd, 0x01bd, + 0x01bf, 0x01bf, + 0x01c4, 0x01c4, + 0x01c6, 0x01c7, + 0x01c9, 0x01ca, + 0x01cc, 0x01cc, + 0x01ce, 0x01ce, + 0x01d0, 0x01d0, + 0x01d2, 0x01d2, + 0x01d4, 0x01d4, + 0x01d6, 0x01d6, + 0x01d8, 0x01d8, + 0x01da, 0x01da, + 0x01dc, 0x01dd, + 0x01df, 0x01df, + 0x01e1, 0x01e1, + 0x01e3, 0x01e3, + 0x01e5, 0x01e5, + 0x01e7, 0x01e7, + 0x01e9, 0x01e9, + 0x01eb, 0x01eb, + 0x01ed, 0x01ed, + 0x01ef, 0x01f1, + 0x01f3, 0x01f3, + 0x01f5, 0x01f5, + 0x01f9, 0x01f9, + 0x01fb, 0x01fb, + 0x01fd, 0x01fd, + 0x01ff, 0x01ff, + 0x0201, 0x0201, + 0x0203, 0x0203, + 0x0205, 0x0205, + 0x0207, 0x0207, + 0x0209, 0x0209, + 0x020b, 0x020b, + 0x020d, 0x020d, + 0x020f, 0x020f, + 0x0211, 0x0211, + 0x0213, 0x0213, + 0x0215, 0x0215, + 0x0217, 0x0217, + 0x0219, 0x0219, + 0x021b, 0x021b, + 0x021d, 0x021d, + 0x021f, 0x021f, + 0x0223, 0x0223, + 0x0225, 0x0225, + 0x0227, 0x0227, + 0x0229, 0x0229, + 0x022b, 0x022b, + 0x022d, 0x022d, + 0x022f, 0x022f, + 0x0231, 0x0231, + 0x0233, 0x0233, + 0x023c, 0x023c, + 0x023f, 0x0240, + 0x0242, 0x0242, + 0x0247, 0x0247, + 0x0249, 0x0249, + 0x024b, 0x024b, + 0x024d, 0x024d, + 0x024f, 0x0254, + 0x0256, 0x0257, + 0x0259, 0x0259, + 0x025b, 0x025b, + 0x0260, 0x0260, + 0x0263, 0x0263, + 0x0268, 0x0269, + 0x026b, 0x026b, + 0x026f, 0x026f, + 0x0271, 0x0272, + 0x0275, 0x0275, + 0x027d, 0x027d, + 0x0280, 0x0280, + 0x0283, 0x0283, + 0x0288, 0x028c, + 0x0292, 0x0292, + 0x0345, 0x0345, + 0x0371, 0x0371, + 0x0373, 0x0373, + 0x0377, 0x0377, + 0x037b, 0x037d, + 0x0390, 0x0390, + 0x03ac, 0x03ce, + 0x03d0, 0x03d1, + 0x03d5, 0x03d7, + 0x03d9, 0x03d9, + 0x03db, 0x03db, + 0x03dd, 0x03dd, + 0x03df, 0x03df, + 0x03e1, 0x03e1, + 0x03e3, 0x03e3, + 0x03e5, 0x03e5, + 0x03e7, 0x03e7, + 0x03e9, 0x03e9, + 0x03eb, 0x03eb, + 0x03ed, 0x03ed, + 0x03ef, 0x03f2, + 0x03f5, 0x03f5, + 0x03f8, 0x03f8, + 0x03fb, 0x03fb, + 0x0430, 0x045f, + 0x0461, 0x0461, + 0x0463, 0x0463, + 0x0465, 0x0465, + 0x0467, 0x0467, + 0x0469, 0x0469, + 0x046b, 0x046b, + 0x046d, 0x046d, + 0x046f, 0x046f, + 0x0471, 0x0471, + 0x0473, 0x0473, + 0x0475, 0x0475, + 0x0477, 0x0477, + 0x0479, 0x0479, + 0x047b, 0x047b, + 0x047d, 0x047d, + 0x047f, 0x047f, + 0x0481, 0x0481, + 0x048b, 0x048b, + 0x048d, 0x048d, + 0x048f, 0x048f, + 0x0491, 0x0491, + 0x0493, 0x0493, + 0x0495, 0x0495, + 0x0497, 0x0497, + 0x0499, 0x0499, + 0x049b, 0x049b, + 0x049d, 0x049d, + 0x049f, 0x049f, + 0x04a1, 0x04a1, + 0x04a3, 0x04a3, + 0x04a5, 0x04a5, + 0x04a7, 0x04a7, + 0x04a9, 0x04a9, + 0x04ab, 0x04ab, + 0x04ad, 0x04ad, + 0x04af, 0x04af, + 0x04b1, 0x04b1, + 0x04b3, 0x04b3, + 0x04b5, 0x04b5, + 0x04b7, 0x04b7, + 0x04b9, 0x04b9, + 0x04bb, 0x04bb, + 0x04bd, 0x04bd, + 0x04bf, 0x04bf, + 0x04c2, 0x04c2, + 0x04c4, 0x04c4, + 0x04c6, 0x04c6, + 0x04c8, 0x04c8, + 0x04ca, 0x04ca, + 0x04cc, 0x04cc, + 0x04ce, 0x04cf, + 0x04d1, 0x04d1, + 0x04d3, 0x04d3, + 0x04d5, 0x04d5, + 0x04d7, 0x04d7, + 0x04d9, 0x04d9, + 0x04db, 0x04db, + 0x04dd, 0x04dd, + 0x04df, 0x04df, + 0x04e1, 0x04e1, + 0x04e3, 0x04e3, + 0x04e5, 0x04e5, + 0x04e7, 0x04e7, + 0x04e9, 0x04e9, + 0x04eb, 0x04eb, + 0x04ed, 0x04ed, + 0x04ef, 0x04ef, + 0x04f1, 0x04f1, + 0x04f3, 0x04f3, + 0x04f5, 0x04f5, + 0x04f7, 0x04f7, + 0x04f9, 0x04f9, + 0x04fb, 0x04fb, + 0x04fd, 0x04fd, + 0x04ff, 0x04ff, + 0x0501, 0x0501, + 0x0503, 0x0503, + 0x0505, 0x0505, + 0x0507, 0x0507, + 0x0509, 0x0509, + 0x050b, 0x050b, + 0x050d, 0x050d, + 0x050f, 0x050f, + 0x0511, 0x0511, + 0x0513, 0x0513, + 0x0515, 0x0515, + 0x0517, 0x0517, + 0x0519, 0x0519, + 0x051b, 0x051b, + 0x051d, 0x051d, + 0x051f, 0x051f, + 0x0521, 0x0521, + 0x0523, 0x0523, + 0x0525, 0x0525, + 0x0561, 0x0587, + 0x1d79, 0x1d79, + 0x1d7d, 0x1d7d, + 0x1e01, 0x1e01, + 0x1e03, 0x1e03, + 0x1e05, 0x1e05, + 0x1e07, 0x1e07, + 0x1e09, 0x1e09, + 0x1e0b, 0x1e0b, + 0x1e0d, 0x1e0d, + 0x1e0f, 0x1e0f, + 0x1e11, 0x1e11, + 0x1e13, 0x1e13, + 0x1e15, 0x1e15, + 0x1e17, 0x1e17, + 0x1e19, 0x1e19, + 0x1e1b, 0x1e1b, + 0x1e1d, 0x1e1d, + 0x1e1f, 0x1e1f, + 0x1e21, 0x1e21, + 0x1e23, 0x1e23, + 0x1e25, 0x1e25, + 0x1e27, 0x1e27, + 0x1e29, 0x1e29, + 0x1e2b, 0x1e2b, + 0x1e2d, 0x1e2d, + 0x1e2f, 0x1e2f, + 0x1e31, 0x1e31, + 0x1e33, 0x1e33, + 0x1e35, 0x1e35, + 0x1e37, 0x1e37, + 0x1e39, 0x1e39, + 0x1e3b, 0x1e3b, + 0x1e3d, 0x1e3d, + 0x1e3f, 0x1e3f, + 0x1e41, 0x1e41, + 0x1e43, 0x1e43, + 0x1e45, 0x1e45, + 0x1e47, 0x1e47, + 0x1e49, 0x1e49, + 0x1e4b, 0x1e4b, + 0x1e4d, 0x1e4d, + 0x1e4f, 0x1e4f, + 0x1e51, 0x1e51, + 0x1e53, 0x1e53, + 0x1e55, 0x1e55, + 0x1e57, 0x1e57, + 0x1e59, 0x1e59, + 0x1e5b, 0x1e5b, + 0x1e5d, 0x1e5d, + 0x1e5f, 0x1e5f, + 0x1e61, 0x1e61, + 0x1e63, 0x1e63, + 0x1e65, 0x1e65, + 0x1e67, 0x1e67, + 0x1e69, 0x1e69, + 0x1e6b, 0x1e6b, + 0x1e6d, 0x1e6d, + 0x1e6f, 0x1e6f, + 0x1e71, 0x1e71, + 0x1e73, 0x1e73, + 0x1e75, 0x1e75, + 0x1e77, 0x1e77, + 0x1e79, 0x1e79, + 0x1e7b, 0x1e7b, + 0x1e7d, 0x1e7d, + 0x1e7f, 0x1e7f, + 0x1e81, 0x1e81, + 0x1e83, 0x1e83, + 0x1e85, 0x1e85, + 0x1e87, 0x1e87, + 0x1e89, 0x1e89, + 0x1e8b, 0x1e8b, + 0x1e8d, 0x1e8d, + 0x1e8f, 0x1e8f, + 0x1e91, 0x1e91, + 0x1e93, 0x1e93, + 0x1e95, 0x1e9b, + 0x1ea1, 0x1ea1, + 0x1ea3, 0x1ea3, + 0x1ea5, 0x1ea5, + 0x1ea7, 0x1ea7, + 0x1ea9, 0x1ea9, + 0x1eab, 0x1eab, + 0x1ead, 0x1ead, + 0x1eaf, 0x1eaf, + 0x1eb1, 0x1eb1, + 0x1eb3, 0x1eb3, + 0x1eb5, 0x1eb5, + 0x1eb7, 0x1eb7, + 0x1eb9, 0x1eb9, + 0x1ebb, 0x1ebb, + 0x1ebd, 0x1ebd, + 0x1ebf, 0x1ebf, + 0x1ec1, 0x1ec1, + 0x1ec3, 0x1ec3, + 0x1ec5, 0x1ec5, + 0x1ec7, 0x1ec7, + 0x1ec9, 0x1ec9, + 0x1ecb, 0x1ecb, + 0x1ecd, 0x1ecd, + 0x1ecf, 0x1ecf, + 0x1ed1, 0x1ed1, + 0x1ed3, 0x1ed3, + 0x1ed5, 0x1ed5, + 0x1ed7, 0x1ed7, + 0x1ed9, 0x1ed9, + 0x1edb, 0x1edb, + 0x1edd, 0x1edd, + 0x1edf, 0x1edf, + 0x1ee1, 0x1ee1, + 0x1ee3, 0x1ee3, + 0x1ee5, 0x1ee5, + 0x1ee7, 0x1ee7, + 0x1ee9, 0x1ee9, + 0x1eeb, 0x1eeb, + 0x1eed, 0x1eed, + 0x1eef, 0x1eef, + 0x1ef1, 0x1ef1, + 0x1ef3, 0x1ef3, + 0x1ef5, 0x1ef5, + 0x1ef7, 0x1ef7, + 0x1ef9, 0x1ef9, + 0x1efb, 0x1efb, + 0x1efd, 0x1efd, + 0x1eff, 0x1f07, + 0x1f10, 0x1f15, + 0x1f20, 0x1f27, + 0x1f30, 0x1f37, + 0x1f40, 0x1f45, + 0x1f50, 0x1f57, + 0x1f60, 0x1f67, + 0x1f70, 0x1f7d, + 0x1f80, 0x1f87, + 0x1f90, 0x1f97, + 0x1fa0, 0x1fa7, + 0x1fb0, 0x1fb4, + 0x1fb6, 0x1fb7, + 0x1fbe, 0x1fbe, + 0x1fc2, 0x1fc4, + 0x1fc6, 0x1fc7, + 0x1fd0, 0x1fd3, + 0x1fd6, 0x1fd7, + 0x1fe0, 0x1fe7, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ff7, + 0x214e, 0x214e, + 0x2170, 0x217f, + 0x2184, 0x2184, + 0x24d0, 0x24e9, + 0x2c30, 0x2c5e, + 0x2c61, 0x2c61, + 0x2c65, 0x2c66, + 0x2c68, 0x2c68, + 0x2c6a, 0x2c6a, + 0x2c6c, 0x2c6c, + 0x2c73, 0x2c73, + 0x2c76, 0x2c76, + 0x2c81, 0x2c81, + 0x2c83, 0x2c83, + 0x2c85, 0x2c85, + 0x2c87, 0x2c87, + 0x2c89, 0x2c89, + 0x2c8b, 0x2c8b, + 0x2c8d, 0x2c8d, + 0x2c8f, 0x2c8f, + 0x2c91, 0x2c91, + 0x2c93, 0x2c93, + 0x2c95, 0x2c95, + 0x2c97, 0x2c97, + 0x2c99, 0x2c99, + 0x2c9b, 0x2c9b, + 0x2c9d, 0x2c9d, + 0x2c9f, 0x2c9f, + 0x2ca1, 0x2ca1, + 0x2ca3, 0x2ca3, + 0x2ca5, 0x2ca5, + 0x2ca7, 0x2ca7, + 0x2ca9, 0x2ca9, + 0x2cab, 0x2cab, + 0x2cad, 0x2cad, + 0x2caf, 0x2caf, + 0x2cb1, 0x2cb1, + 0x2cb3, 0x2cb3, + 0x2cb5, 0x2cb5, + 0x2cb7, 0x2cb7, + 0x2cb9, 0x2cb9, + 0x2cbb, 0x2cbb, + 0x2cbd, 0x2cbd, + 0x2cbf, 0x2cbf, + 0x2cc1, 0x2cc1, + 0x2cc3, 0x2cc3, + 0x2cc5, 0x2cc5, + 0x2cc7, 0x2cc7, + 0x2cc9, 0x2cc9, + 0x2ccb, 0x2ccb, + 0x2ccd, 0x2ccd, + 0x2ccf, 0x2ccf, + 0x2cd1, 0x2cd1, + 0x2cd3, 0x2cd3, + 0x2cd5, 0x2cd5, + 0x2cd7, 0x2cd7, + 0x2cd9, 0x2cd9, + 0x2cdb, 0x2cdb, + 0x2cdd, 0x2cdd, + 0x2cdf, 0x2cdf, + 0x2ce1, 0x2ce1, + 0x2ce3, 0x2ce3, + 0x2cec, 0x2cec, + 0x2cee, 0x2cee, + 0x2d00, 0x2d25, + 0xa641, 0xa641, + 0xa643, 0xa643, + 0xa645, 0xa645, + 0xa647, 0xa647, + 0xa649, 0xa649, + 0xa64b, 0xa64b, + 0xa64d, 0xa64d, + 0xa64f, 0xa64f, + 0xa651, 0xa651, + 0xa653, 0xa653, + 0xa655, 0xa655, + 0xa657, 0xa657, + 0xa659, 0xa659, + 0xa65b, 0xa65b, + 0xa65d, 0xa65d, + 0xa65f, 0xa65f, + 0xa663, 0xa663, + 0xa665, 0xa665, + 0xa667, 0xa667, + 0xa669, 0xa669, + 0xa66b, 0xa66b, + 0xa66d, 0xa66d, + 0xa681, 0xa681, + 0xa683, 0xa683, + 0xa685, 0xa685, + 0xa687, 0xa687, + 0xa689, 0xa689, + 0xa68b, 0xa68b, + 0xa68d, 0xa68d, + 0xa68f, 0xa68f, + 0xa691, 0xa691, + 0xa693, 0xa693, + 0xa695, 0xa695, + 0xa697, 0xa697, + 0xa723, 0xa723, + 0xa725, 0xa725, + 0xa727, 0xa727, + 0xa729, 0xa729, + 0xa72b, 0xa72b, + 0xa72d, 0xa72d, + 0xa72f, 0xa72f, + 0xa733, 0xa733, + 0xa735, 0xa735, + 0xa737, 0xa737, + 0xa739, 0xa739, + 0xa73b, 0xa73b, + 0xa73d, 0xa73d, + 0xa73f, 0xa73f, + 0xa741, 0xa741, + 0xa743, 0xa743, + 0xa745, 0xa745, + 0xa747, 0xa747, + 0xa749, 0xa749, + 0xa74b, 0xa74b, + 0xa74d, 0xa74d, + 0xa74f, 0xa74f, + 0xa751, 0xa751, + 0xa753, 0xa753, + 0xa755, 0xa755, + 0xa757, 0xa757, + 0xa759, 0xa759, + 0xa75b, 0xa75b, + 0xa75d, 0xa75d, + 0xa75f, 0xa75f, + 0xa761, 0xa761, + 0xa763, 0xa763, + 0xa765, 0xa765, + 0xa767, 0xa767, + 0xa769, 0xa769, + 0xa76b, 0xa76b, + 0xa76d, 0xa76d, + 0xa76f, 0xa76f, + 0xa77a, 0xa77a, + 0xa77c, 0xa77c, + 0xa77f, 0xa77f, + 0xa781, 0xa781, + 0xa783, 0xa783, + 0xa785, 0xa785, + 0xa787, 0xa787, + 0xa78c, 0xa78c, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xff41, 0xff5a, + 0x10428, 0x1044f, +}; /* CR_Changes_When_Titlecased */ + +/* 'Changes_When_Casefolded': Derived Property */ +static const OnigCodePoint CR_Changes_When_Casefolded[] = { + 568, + 0x0041, 0x005a, + 0x00b5, 0x00b5, + 0x00c0, 0x00d6, + 0x00d8, 0x00df, + 0x0100, 0x0100, + 0x0102, 0x0102, + 0x0104, 0x0104, + 0x0106, 0x0106, + 0x0108, 0x0108, + 0x010a, 0x010a, + 0x010c, 0x010c, + 0x010e, 0x010e, + 0x0110, 0x0110, + 0x0112, 0x0112, + 0x0114, 0x0114, + 0x0116, 0x0116, + 0x0118, 0x0118, + 0x011a, 0x011a, + 0x011c, 0x011c, + 0x011e, 0x011e, + 0x0120, 0x0120, + 0x0122, 0x0122, + 0x0124, 0x0124, + 0x0126, 0x0126, + 0x0128, 0x0128, + 0x012a, 0x012a, + 0x012c, 0x012c, + 0x012e, 0x012e, + 0x0130, 0x0130, + 0x0132, 0x0132, + 0x0134, 0x0134, + 0x0136, 0x0136, + 0x0139, 0x0139, + 0x013b, 0x013b, + 0x013d, 0x013d, + 0x013f, 0x013f, + 0x0141, 0x0141, + 0x0143, 0x0143, + 0x0145, 0x0145, + 0x0147, 0x0147, + 0x0149, 0x014a, + 0x014c, 0x014c, + 0x014e, 0x014e, + 0x0150, 0x0150, + 0x0152, 0x0152, + 0x0154, 0x0154, + 0x0156, 0x0156, + 0x0158, 0x0158, + 0x015a, 0x015a, + 0x015c, 0x015c, + 0x015e, 0x015e, + 0x0160, 0x0160, + 0x0162, 0x0162, + 0x0164, 0x0164, + 0x0166, 0x0166, + 0x0168, 0x0168, + 0x016a, 0x016a, + 0x016c, 0x016c, + 0x016e, 0x016e, + 0x0170, 0x0170, + 0x0172, 0x0172, + 0x0174, 0x0174, + 0x0176, 0x0176, + 0x0178, 0x0179, + 0x017b, 0x017b, + 0x017d, 0x017d, + 0x017f, 0x017f, + 0x0181, 0x0182, + 0x0184, 0x0184, + 0x0186, 0x0187, + 0x0189, 0x018b, + 0x018e, 0x0191, + 0x0193, 0x0194, + 0x0196, 0x0198, + 0x019c, 0x019d, + 0x019f, 0x01a0, + 0x01a2, 0x01a2, + 0x01a4, 0x01a4, + 0x01a6, 0x01a7, + 0x01a9, 0x01a9, + 0x01ac, 0x01ac, + 0x01ae, 0x01af, + 0x01b1, 0x01b3, + 0x01b5, 0x01b5, + 0x01b7, 0x01b8, + 0x01bc, 0x01bc, + 0x01c4, 0x01c5, + 0x01c7, 0x01c8, + 0x01ca, 0x01cb, + 0x01cd, 0x01cd, + 0x01cf, 0x01cf, + 0x01d1, 0x01d1, + 0x01d3, 0x01d3, + 0x01d5, 0x01d5, + 0x01d7, 0x01d7, + 0x01d9, 0x01d9, + 0x01db, 0x01db, + 0x01de, 0x01de, + 0x01e0, 0x01e0, + 0x01e2, 0x01e2, + 0x01e4, 0x01e4, + 0x01e6, 0x01e6, + 0x01e8, 0x01e8, + 0x01ea, 0x01ea, + 0x01ec, 0x01ec, + 0x01ee, 0x01ee, + 0x01f1, 0x01f2, + 0x01f4, 0x01f4, + 0x01f6, 0x01f8, + 0x01fa, 0x01fa, + 0x01fc, 0x01fc, + 0x01fe, 0x01fe, + 0x0200, 0x0200, + 0x0202, 0x0202, + 0x0204, 0x0204, + 0x0206, 0x0206, + 0x0208, 0x0208, + 0x020a, 0x020a, + 0x020c, 0x020c, + 0x020e, 0x020e, + 0x0210, 0x0210, + 0x0212, 0x0212, + 0x0214, 0x0214, + 0x0216, 0x0216, + 0x0218, 0x0218, + 0x021a, 0x021a, + 0x021c, 0x021c, + 0x021e, 0x021e, + 0x0220, 0x0220, + 0x0222, 0x0222, + 0x0224, 0x0224, + 0x0226, 0x0226, + 0x0228, 0x0228, + 0x022a, 0x022a, + 0x022c, 0x022c, + 0x022e, 0x022e, + 0x0230, 0x0230, + 0x0232, 0x0232, + 0x023a, 0x023b, + 0x023d, 0x023e, + 0x0241, 0x0241, + 0x0243, 0x0246, + 0x0248, 0x0248, + 0x024a, 0x024a, + 0x024c, 0x024c, + 0x024e, 0x024e, + 0x0345, 0x0345, + 0x0370, 0x0370, + 0x0372, 0x0372, + 0x0376, 0x0376, + 0x0386, 0x0386, + 0x0388, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x038f, + 0x0391, 0x03a1, + 0x03a3, 0x03ab, + 0x03c2, 0x03c2, + 0x03cf, 0x03d1, + 0x03d5, 0x03d6, + 0x03d8, 0x03d8, + 0x03da, 0x03da, + 0x03dc, 0x03dc, + 0x03de, 0x03de, + 0x03e0, 0x03e0, + 0x03e2, 0x03e2, + 0x03e4, 0x03e4, + 0x03e6, 0x03e6, + 0x03e8, 0x03e8, + 0x03ea, 0x03ea, + 0x03ec, 0x03ec, + 0x03ee, 0x03ee, + 0x03f0, 0x03f1, + 0x03f4, 0x03f5, + 0x03f7, 0x03f7, + 0x03f9, 0x03fa, + 0x03fd, 0x042f, + 0x0460, 0x0460, + 0x0462, 0x0462, + 0x0464, 0x0464, + 0x0466, 0x0466, + 0x0468, 0x0468, + 0x046a, 0x046a, + 0x046c, 0x046c, + 0x046e, 0x046e, + 0x0470, 0x0470, + 0x0472, 0x0472, + 0x0474, 0x0474, + 0x0476, 0x0476, + 0x0478, 0x0478, + 0x047a, 0x047a, + 0x047c, 0x047c, + 0x047e, 0x047e, + 0x0480, 0x0480, + 0x048a, 0x048a, + 0x048c, 0x048c, + 0x048e, 0x048e, + 0x0490, 0x0490, + 0x0492, 0x0492, + 0x0494, 0x0494, + 0x0496, 0x0496, + 0x0498, 0x0498, + 0x049a, 0x049a, + 0x049c, 0x049c, + 0x049e, 0x049e, + 0x04a0, 0x04a0, + 0x04a2, 0x04a2, + 0x04a4, 0x04a4, + 0x04a6, 0x04a6, + 0x04a8, 0x04a8, + 0x04aa, 0x04aa, + 0x04ac, 0x04ac, + 0x04ae, 0x04ae, + 0x04b0, 0x04b0, + 0x04b2, 0x04b2, + 0x04b4, 0x04b4, + 0x04b6, 0x04b6, + 0x04b8, 0x04b8, + 0x04ba, 0x04ba, + 0x04bc, 0x04bc, + 0x04be, 0x04be, + 0x04c0, 0x04c1, + 0x04c3, 0x04c3, + 0x04c5, 0x04c5, + 0x04c7, 0x04c7, + 0x04c9, 0x04c9, + 0x04cb, 0x04cb, + 0x04cd, 0x04cd, + 0x04d0, 0x04d0, + 0x04d2, 0x04d2, + 0x04d4, 0x04d4, + 0x04d6, 0x04d6, + 0x04d8, 0x04d8, + 0x04da, 0x04da, + 0x04dc, 0x04dc, + 0x04de, 0x04de, + 0x04e0, 0x04e0, + 0x04e2, 0x04e2, + 0x04e4, 0x04e4, + 0x04e6, 0x04e6, + 0x04e8, 0x04e8, + 0x04ea, 0x04ea, + 0x04ec, 0x04ec, + 0x04ee, 0x04ee, + 0x04f0, 0x04f0, + 0x04f2, 0x04f2, + 0x04f4, 0x04f4, + 0x04f6, 0x04f6, + 0x04f8, 0x04f8, + 0x04fa, 0x04fa, + 0x04fc, 0x04fc, + 0x04fe, 0x04fe, + 0x0500, 0x0500, + 0x0502, 0x0502, + 0x0504, 0x0504, + 0x0506, 0x0506, + 0x0508, 0x0508, + 0x050a, 0x050a, + 0x050c, 0x050c, + 0x050e, 0x050e, + 0x0510, 0x0510, + 0x0512, 0x0512, + 0x0514, 0x0514, + 0x0516, 0x0516, + 0x0518, 0x0518, + 0x051a, 0x051a, + 0x051c, 0x051c, + 0x051e, 0x051e, + 0x0520, 0x0520, + 0x0522, 0x0522, + 0x0524, 0x0524, + 0x0531, 0x0556, + 0x0587, 0x0587, + 0x10a0, 0x10c5, + 0x1e00, 0x1e00, + 0x1e02, 0x1e02, + 0x1e04, 0x1e04, + 0x1e06, 0x1e06, + 0x1e08, 0x1e08, + 0x1e0a, 0x1e0a, + 0x1e0c, 0x1e0c, + 0x1e0e, 0x1e0e, + 0x1e10, 0x1e10, + 0x1e12, 0x1e12, + 0x1e14, 0x1e14, + 0x1e16, 0x1e16, + 0x1e18, 0x1e18, + 0x1e1a, 0x1e1a, + 0x1e1c, 0x1e1c, + 0x1e1e, 0x1e1e, + 0x1e20, 0x1e20, + 0x1e22, 0x1e22, + 0x1e24, 0x1e24, + 0x1e26, 0x1e26, + 0x1e28, 0x1e28, + 0x1e2a, 0x1e2a, + 0x1e2c, 0x1e2c, + 0x1e2e, 0x1e2e, + 0x1e30, 0x1e30, + 0x1e32, 0x1e32, + 0x1e34, 0x1e34, + 0x1e36, 0x1e36, + 0x1e38, 0x1e38, + 0x1e3a, 0x1e3a, + 0x1e3c, 0x1e3c, + 0x1e3e, 0x1e3e, + 0x1e40, 0x1e40, + 0x1e42, 0x1e42, + 0x1e44, 0x1e44, + 0x1e46, 0x1e46, + 0x1e48, 0x1e48, + 0x1e4a, 0x1e4a, + 0x1e4c, 0x1e4c, + 0x1e4e, 0x1e4e, + 0x1e50, 0x1e50, + 0x1e52, 0x1e52, + 0x1e54, 0x1e54, + 0x1e56, 0x1e56, + 0x1e58, 0x1e58, + 0x1e5a, 0x1e5a, + 0x1e5c, 0x1e5c, + 0x1e5e, 0x1e5e, + 0x1e60, 0x1e60, + 0x1e62, 0x1e62, + 0x1e64, 0x1e64, + 0x1e66, 0x1e66, + 0x1e68, 0x1e68, + 0x1e6a, 0x1e6a, + 0x1e6c, 0x1e6c, + 0x1e6e, 0x1e6e, + 0x1e70, 0x1e70, + 0x1e72, 0x1e72, + 0x1e74, 0x1e74, + 0x1e76, 0x1e76, + 0x1e78, 0x1e78, + 0x1e7a, 0x1e7a, + 0x1e7c, 0x1e7c, + 0x1e7e, 0x1e7e, + 0x1e80, 0x1e80, + 0x1e82, 0x1e82, + 0x1e84, 0x1e84, + 0x1e86, 0x1e86, + 0x1e88, 0x1e88, + 0x1e8a, 0x1e8a, + 0x1e8c, 0x1e8c, + 0x1e8e, 0x1e8e, + 0x1e90, 0x1e90, + 0x1e92, 0x1e92, + 0x1e94, 0x1e94, + 0x1e9a, 0x1e9b, + 0x1e9e, 0x1e9e, + 0x1ea0, 0x1ea0, + 0x1ea2, 0x1ea2, + 0x1ea4, 0x1ea4, + 0x1ea6, 0x1ea6, + 0x1ea8, 0x1ea8, + 0x1eaa, 0x1eaa, + 0x1eac, 0x1eac, + 0x1eae, 0x1eae, + 0x1eb0, 0x1eb0, + 0x1eb2, 0x1eb2, + 0x1eb4, 0x1eb4, + 0x1eb6, 0x1eb6, + 0x1eb8, 0x1eb8, + 0x1eba, 0x1eba, + 0x1ebc, 0x1ebc, + 0x1ebe, 0x1ebe, + 0x1ec0, 0x1ec0, + 0x1ec2, 0x1ec2, + 0x1ec4, 0x1ec4, + 0x1ec6, 0x1ec6, + 0x1ec8, 0x1ec8, + 0x1eca, 0x1eca, + 0x1ecc, 0x1ecc, + 0x1ece, 0x1ece, + 0x1ed0, 0x1ed0, + 0x1ed2, 0x1ed2, + 0x1ed4, 0x1ed4, + 0x1ed6, 0x1ed6, + 0x1ed8, 0x1ed8, + 0x1eda, 0x1eda, + 0x1edc, 0x1edc, + 0x1ede, 0x1ede, + 0x1ee0, 0x1ee0, + 0x1ee2, 0x1ee2, + 0x1ee4, 0x1ee4, + 0x1ee6, 0x1ee6, + 0x1ee8, 0x1ee8, + 0x1eea, 0x1eea, + 0x1eec, 0x1eec, + 0x1eee, 0x1eee, + 0x1ef0, 0x1ef0, + 0x1ef2, 0x1ef2, + 0x1ef4, 0x1ef4, + 0x1ef6, 0x1ef6, + 0x1ef8, 0x1ef8, + 0x1efa, 0x1efa, + 0x1efc, 0x1efc, + 0x1efe, 0x1efe, + 0x1f08, 0x1f0f, + 0x1f18, 0x1f1d, + 0x1f28, 0x1f2f, + 0x1f38, 0x1f3f, + 0x1f48, 0x1f4d, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f5f, + 0x1f68, 0x1f6f, + 0x1f80, 0x1faf, + 0x1fb2, 0x1fb4, + 0x1fb7, 0x1fbc, + 0x1fc2, 0x1fc4, + 0x1fc7, 0x1fcc, + 0x1fd8, 0x1fdb, + 0x1fe8, 0x1fec, + 0x1ff2, 0x1ff4, + 0x1ff7, 0x1ffc, + 0x2126, 0x2126, + 0x212a, 0x212b, + 0x2132, 0x2132, + 0x2160, 0x216f, + 0x2183, 0x2183, + 0x24b6, 0x24cf, + 0x2c00, 0x2c2e, + 0x2c60, 0x2c60, + 0x2c62, 0x2c64, + 0x2c67, 0x2c67, + 0x2c69, 0x2c69, + 0x2c6b, 0x2c6b, + 0x2c6d, 0x2c70, + 0x2c72, 0x2c72, + 0x2c75, 0x2c75, + 0x2c7e, 0x2c80, + 0x2c82, 0x2c82, + 0x2c84, 0x2c84, + 0x2c86, 0x2c86, + 0x2c88, 0x2c88, + 0x2c8a, 0x2c8a, + 0x2c8c, 0x2c8c, + 0x2c8e, 0x2c8e, + 0x2c90, 0x2c90, + 0x2c92, 0x2c92, + 0x2c94, 0x2c94, + 0x2c96, 0x2c96, + 0x2c98, 0x2c98, + 0x2c9a, 0x2c9a, + 0x2c9c, 0x2c9c, + 0x2c9e, 0x2c9e, + 0x2ca0, 0x2ca0, + 0x2ca2, 0x2ca2, + 0x2ca4, 0x2ca4, + 0x2ca6, 0x2ca6, + 0x2ca8, 0x2ca8, + 0x2caa, 0x2caa, + 0x2cac, 0x2cac, + 0x2cae, 0x2cae, + 0x2cb0, 0x2cb0, + 0x2cb2, 0x2cb2, + 0x2cb4, 0x2cb4, + 0x2cb6, 0x2cb6, + 0x2cb8, 0x2cb8, + 0x2cba, 0x2cba, + 0x2cbc, 0x2cbc, + 0x2cbe, 0x2cbe, + 0x2cc0, 0x2cc0, + 0x2cc2, 0x2cc2, + 0x2cc4, 0x2cc4, + 0x2cc6, 0x2cc6, + 0x2cc8, 0x2cc8, + 0x2cca, 0x2cca, + 0x2ccc, 0x2ccc, + 0x2cce, 0x2cce, + 0x2cd0, 0x2cd0, + 0x2cd2, 0x2cd2, + 0x2cd4, 0x2cd4, + 0x2cd6, 0x2cd6, + 0x2cd8, 0x2cd8, + 0x2cda, 0x2cda, + 0x2cdc, 0x2cdc, + 0x2cde, 0x2cde, + 0x2ce0, 0x2ce0, + 0x2ce2, 0x2ce2, + 0x2ceb, 0x2ceb, + 0x2ced, 0x2ced, + 0xa640, 0xa640, + 0xa642, 0xa642, + 0xa644, 0xa644, + 0xa646, 0xa646, + 0xa648, 0xa648, + 0xa64a, 0xa64a, + 0xa64c, 0xa64c, + 0xa64e, 0xa64e, + 0xa650, 0xa650, + 0xa652, 0xa652, + 0xa654, 0xa654, + 0xa656, 0xa656, + 0xa658, 0xa658, + 0xa65a, 0xa65a, + 0xa65c, 0xa65c, + 0xa65e, 0xa65e, + 0xa662, 0xa662, + 0xa664, 0xa664, + 0xa666, 0xa666, + 0xa668, 0xa668, + 0xa66a, 0xa66a, + 0xa66c, 0xa66c, + 0xa680, 0xa680, + 0xa682, 0xa682, + 0xa684, 0xa684, + 0xa686, 0xa686, + 0xa688, 0xa688, + 0xa68a, 0xa68a, + 0xa68c, 0xa68c, + 0xa68e, 0xa68e, + 0xa690, 0xa690, + 0xa692, 0xa692, + 0xa694, 0xa694, + 0xa696, 0xa696, + 0xa722, 0xa722, + 0xa724, 0xa724, + 0xa726, 0xa726, + 0xa728, 0xa728, + 0xa72a, 0xa72a, + 0xa72c, 0xa72c, + 0xa72e, 0xa72e, + 0xa732, 0xa732, + 0xa734, 0xa734, + 0xa736, 0xa736, + 0xa738, 0xa738, + 0xa73a, 0xa73a, + 0xa73c, 0xa73c, + 0xa73e, 0xa73e, + 0xa740, 0xa740, + 0xa742, 0xa742, + 0xa744, 0xa744, + 0xa746, 0xa746, + 0xa748, 0xa748, + 0xa74a, 0xa74a, + 0xa74c, 0xa74c, + 0xa74e, 0xa74e, + 0xa750, 0xa750, + 0xa752, 0xa752, + 0xa754, 0xa754, + 0xa756, 0xa756, + 0xa758, 0xa758, + 0xa75a, 0xa75a, + 0xa75c, 0xa75c, + 0xa75e, 0xa75e, + 0xa760, 0xa760, + 0xa762, 0xa762, + 0xa764, 0xa764, + 0xa766, 0xa766, + 0xa768, 0xa768, + 0xa76a, 0xa76a, + 0xa76c, 0xa76c, + 0xa76e, 0xa76e, + 0xa779, 0xa779, + 0xa77b, 0xa77b, + 0xa77d, 0xa77e, + 0xa780, 0xa780, + 0xa782, 0xa782, + 0xa784, 0xa784, + 0xa786, 0xa786, + 0xa78b, 0xa78b, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xff21, 0xff3a, + 0x10400, 0x10427, +}; /* CR_Changes_When_Casefolded */ + +/* 'Changes_When_Casemapped': Derived Property */ +static const OnigCodePoint CR_Changes_When_Casemapped[] = { + 97, + 0x0041, 0x005a, + 0x0061, 0x007a, + 0x00b5, 0x00b5, + 0x00c0, 0x00d6, + 0x00d8, 0x00f6, + 0x00f8, 0x0137, + 0x0139, 0x018c, + 0x018e, 0x019a, + 0x019c, 0x01a9, + 0x01ac, 0x01b9, + 0x01bc, 0x01bd, + 0x01bf, 0x01bf, + 0x01c4, 0x0220, + 0x0222, 0x0233, + 0x023a, 0x0254, + 0x0256, 0x0257, + 0x0259, 0x0259, + 0x025b, 0x025b, + 0x0260, 0x0260, + 0x0263, 0x0263, + 0x0268, 0x0269, + 0x026b, 0x026b, + 0x026f, 0x026f, + 0x0271, 0x0272, + 0x0275, 0x0275, + 0x027d, 0x027d, + 0x0280, 0x0280, + 0x0283, 0x0283, + 0x0288, 0x028c, + 0x0292, 0x0292, + 0x0345, 0x0345, + 0x0370, 0x0373, + 0x0376, 0x0377, + 0x037b, 0x037d, + 0x0386, 0x0386, + 0x0388, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x03a1, + 0x03a3, 0x03d1, + 0x03d5, 0x03f2, + 0x03f4, 0x03f5, + 0x03f7, 0x03fb, + 0x03fd, 0x0481, + 0x048a, 0x0525, + 0x0531, 0x0556, + 0x0561, 0x0587, + 0x10a0, 0x10c5, + 0x1d79, 0x1d79, + 0x1d7d, 0x1d7d, + 0x1e00, 0x1e9b, + 0x1e9e, 0x1e9e, + 0x1ea0, 0x1f15, + 0x1f18, 0x1f1d, + 0x1f20, 0x1f45, + 0x1f48, 0x1f4d, + 0x1f50, 0x1f57, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f7d, + 0x1f80, 0x1fb4, + 0x1fb6, 0x1fbc, + 0x1fbe, 0x1fbe, + 0x1fc2, 0x1fc4, + 0x1fc6, 0x1fcc, + 0x1fd0, 0x1fd3, + 0x1fd6, 0x1fdb, + 0x1fe0, 0x1fec, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ffc, + 0x2126, 0x2126, + 0x212a, 0x212b, + 0x2132, 0x2132, + 0x214e, 0x214e, + 0x2160, 0x217f, + 0x2183, 0x2184, + 0x24b6, 0x24e9, + 0x2c00, 0x2c2e, + 0x2c30, 0x2c5e, + 0x2c60, 0x2c70, + 0x2c72, 0x2c73, + 0x2c75, 0x2c76, + 0x2c7e, 0x2ce3, + 0x2ceb, 0x2cee, + 0x2d00, 0x2d25, + 0xa640, 0xa65f, + 0xa662, 0xa66d, + 0xa680, 0xa697, + 0xa722, 0xa72f, + 0xa732, 0xa76f, + 0xa779, 0xa787, + 0xa78b, 0xa78c, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xff21, 0xff3a, + 0xff41, 0xff5a, + 0x10400, 0x1044f, +}; /* CR_Changes_When_Casemapped */ + +/* 'ID_Start': Derived Property */ +static const OnigCodePoint CR_ID_Start[] = { + 424, + 0x0041, 0x005a, + 0x0061, 0x007a, + 0x00aa, 0x00aa, + 0x00b5, 0x00b5, + 0x00ba, 0x00ba, + 0x00c0, 0x00d6, + 0x00d8, 0x00f6, + 0x00f8, 0x02c1, + 0x02c6, 0x02d1, + 0x02e0, 0x02e4, + 0x02ec, 0x02ec, + 0x02ee, 0x02ee, + 0x0370, 0x0374, + 0x0376, 0x0377, + 0x037a, 0x037d, + 0x0386, 0x0386, + 0x0388, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x03a1, + 0x03a3, 0x03f5, + 0x03f7, 0x0481, + 0x048a, 0x0525, + 0x0531, 0x0556, + 0x0559, 0x0559, + 0x0561, 0x0587, + 0x05d0, 0x05ea, + 0x05f0, 0x05f2, + 0x0621, 0x064a, + 0x066e, 0x066f, + 0x0671, 0x06d3, + 0x06d5, 0x06d5, + 0x06e5, 0x06e6, + 0x06ee, 0x06ef, + 0x06fa, 0x06fc, + 0x06ff, 0x06ff, + 0x0710, 0x0710, + 0x0712, 0x072f, + 0x074d, 0x07a5, + 0x07b1, 0x07b1, + 0x07ca, 0x07ea, + 0x07f4, 0x07f5, + 0x07fa, 0x07fa, + 0x0800, 0x0815, + 0x081a, 0x081a, + 0x0824, 0x0824, + 0x0828, 0x0828, + 0x0904, 0x0939, + 0x093d, 0x093d, + 0x0950, 0x0950, + 0x0958, 0x0961, + 0x0971, 0x0972, + 0x0979, 0x097f, + 0x0985, 0x098c, + 0x098f, 0x0990, + 0x0993, 0x09a8, + 0x09aa, 0x09b0, + 0x09b2, 0x09b2, + 0x09b6, 0x09b9, + 0x09bd, 0x09bd, + 0x09ce, 0x09ce, + 0x09dc, 0x09dd, + 0x09df, 0x09e1, + 0x09f0, 0x09f1, + 0x0a05, 0x0a0a, + 0x0a0f, 0x0a10, + 0x0a13, 0x0a28, + 0x0a2a, 0x0a30, + 0x0a32, 0x0a33, + 0x0a35, 0x0a36, + 0x0a38, 0x0a39, + 0x0a59, 0x0a5c, + 0x0a5e, 0x0a5e, + 0x0a72, 0x0a74, + 0x0a85, 0x0a8d, + 0x0a8f, 0x0a91, + 0x0a93, 0x0aa8, + 0x0aaa, 0x0ab0, + 0x0ab2, 0x0ab3, + 0x0ab5, 0x0ab9, + 0x0abd, 0x0abd, + 0x0ad0, 0x0ad0, + 0x0ae0, 0x0ae1, + 0x0b05, 0x0b0c, + 0x0b0f, 0x0b10, + 0x0b13, 0x0b28, + 0x0b2a, 0x0b30, + 0x0b32, 0x0b33, + 0x0b35, 0x0b39, + 0x0b3d, 0x0b3d, + 0x0b5c, 0x0b5d, + 0x0b5f, 0x0b61, + 0x0b71, 0x0b71, + 0x0b83, 0x0b83, + 0x0b85, 0x0b8a, + 0x0b8e, 0x0b90, + 0x0b92, 0x0b95, + 0x0b99, 0x0b9a, + 0x0b9c, 0x0b9c, + 0x0b9e, 0x0b9f, + 0x0ba3, 0x0ba4, + 0x0ba8, 0x0baa, + 0x0bae, 0x0bb9, + 0x0bd0, 0x0bd0, + 0x0c05, 0x0c0c, + 0x0c0e, 0x0c10, + 0x0c12, 0x0c28, + 0x0c2a, 0x0c33, + 0x0c35, 0x0c39, + 0x0c3d, 0x0c3d, + 0x0c58, 0x0c59, + 0x0c60, 0x0c61, + 0x0c85, 0x0c8c, + 0x0c8e, 0x0c90, + 0x0c92, 0x0ca8, + 0x0caa, 0x0cb3, + 0x0cb5, 0x0cb9, + 0x0cbd, 0x0cbd, + 0x0cde, 0x0cde, + 0x0ce0, 0x0ce1, + 0x0d05, 0x0d0c, + 0x0d0e, 0x0d10, + 0x0d12, 0x0d28, + 0x0d2a, 0x0d39, + 0x0d3d, 0x0d3d, + 0x0d60, 0x0d61, + 0x0d7a, 0x0d7f, + 0x0d85, 0x0d96, + 0x0d9a, 0x0db1, + 0x0db3, 0x0dbb, + 0x0dbd, 0x0dbd, + 0x0dc0, 0x0dc6, + 0x0e01, 0x0e30, + 0x0e32, 0x0e33, + 0x0e40, 0x0e46, + 0x0e81, 0x0e82, + 0x0e84, 0x0e84, + 0x0e87, 0x0e88, + 0x0e8a, 0x0e8a, + 0x0e8d, 0x0e8d, + 0x0e94, 0x0e97, + 0x0e99, 0x0e9f, + 0x0ea1, 0x0ea3, + 0x0ea5, 0x0ea5, + 0x0ea7, 0x0ea7, + 0x0eaa, 0x0eab, + 0x0ead, 0x0eb0, + 0x0eb2, 0x0eb3, + 0x0ebd, 0x0ebd, + 0x0ec0, 0x0ec4, + 0x0ec6, 0x0ec6, + 0x0edc, 0x0edd, + 0x0f00, 0x0f00, + 0x0f40, 0x0f47, + 0x0f49, 0x0f6c, + 0x0f88, 0x0f8b, + 0x1000, 0x102a, + 0x103f, 0x103f, + 0x1050, 0x1055, + 0x105a, 0x105d, + 0x1061, 0x1061, + 0x1065, 0x1066, + 0x106e, 0x1070, + 0x1075, 0x1081, + 0x108e, 0x108e, + 0x10a0, 0x10c5, + 0x10d0, 0x10fa, + 0x10fc, 0x10fc, + 0x1100, 0x1248, + 0x124a, 0x124d, + 0x1250, 0x1256, + 0x1258, 0x1258, + 0x125a, 0x125d, + 0x1260, 0x1288, + 0x128a, 0x128d, + 0x1290, 0x12b0, + 0x12b2, 0x12b5, + 0x12b8, 0x12be, + 0x12c0, 0x12c0, + 0x12c2, 0x12c5, + 0x12c8, 0x12d6, + 0x12d8, 0x1310, + 0x1312, 0x1315, + 0x1318, 0x135a, + 0x1380, 0x138f, + 0x13a0, 0x13f4, + 0x1401, 0x166c, + 0x166f, 0x167f, + 0x1681, 0x169a, + 0x16a0, 0x16ea, + 0x16ee, 0x16f0, + 0x1700, 0x170c, + 0x170e, 0x1711, + 0x1720, 0x1731, + 0x1740, 0x1751, + 0x1760, 0x176c, + 0x176e, 0x1770, + 0x1780, 0x17b3, + 0x17d7, 0x17d7, + 0x17dc, 0x17dc, + 0x1820, 0x1877, + 0x1880, 0x18a8, + 0x18aa, 0x18aa, + 0x18b0, 0x18f5, + 0x1900, 0x191c, + 0x1950, 0x196d, + 0x1970, 0x1974, + 0x1980, 0x19ab, + 0x19c1, 0x19c7, + 0x1a00, 0x1a16, + 0x1a20, 0x1a54, + 0x1aa7, 0x1aa7, + 0x1b05, 0x1b33, + 0x1b45, 0x1b4b, + 0x1b83, 0x1ba0, + 0x1bae, 0x1baf, + 0x1c00, 0x1c23, + 0x1c4d, 0x1c4f, + 0x1c5a, 0x1c7d, + 0x1ce9, 0x1cec, + 0x1cee, 0x1cf1, + 0x1d00, 0x1dbf, + 0x1e00, 0x1f15, + 0x1f18, 0x1f1d, + 0x1f20, 0x1f45, + 0x1f48, 0x1f4d, + 0x1f50, 0x1f57, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f7d, + 0x1f80, 0x1fb4, + 0x1fb6, 0x1fbc, + 0x1fbe, 0x1fbe, + 0x1fc2, 0x1fc4, + 0x1fc6, 0x1fcc, + 0x1fd0, 0x1fd3, + 0x1fd6, 0x1fdb, + 0x1fe0, 0x1fec, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ffc, + 0x2071, 0x2071, + 0x207f, 0x207f, + 0x2090, 0x2094, + 0x2102, 0x2102, + 0x2107, 0x2107, + 0x210a, 0x2113, + 0x2115, 0x2115, + 0x2118, 0x211d, + 0x2124, 0x2124, + 0x2126, 0x2126, + 0x2128, 0x2128, + 0x212a, 0x2139, + 0x213c, 0x213f, + 0x2145, 0x2149, + 0x214e, 0x214e, + 0x2160, 0x2188, + 0x2c00, 0x2c2e, + 0x2c30, 0x2c5e, + 0x2c60, 0x2ce4, + 0x2ceb, 0x2cee, + 0x2d00, 0x2d25, + 0x2d30, 0x2d65, + 0x2d6f, 0x2d6f, + 0x2d80, 0x2d96, + 0x2da0, 0x2da6, + 0x2da8, 0x2dae, + 0x2db0, 0x2db6, + 0x2db8, 0x2dbe, + 0x2dc0, 0x2dc6, + 0x2dc8, 0x2dce, + 0x2dd0, 0x2dd6, + 0x2dd8, 0x2dde, + 0x3005, 0x3007, + 0x3021, 0x3029, + 0x3031, 0x3035, + 0x3038, 0x303c, + 0x3041, 0x3096, + 0x309b, 0x309f, + 0x30a1, 0x30fa, + 0x30fc, 0x30ff, + 0x3105, 0x312d, + 0x3131, 0x318e, + 0x31a0, 0x31b7, + 0x31f0, 0x31ff, + 0x3400, 0x4db5, + 0x4e00, 0x9fcb, + 0xa000, 0xa48c, + 0xa4d0, 0xa4fd, + 0xa500, 0xa60c, + 0xa610, 0xa61f, + 0xa62a, 0xa62b, + 0xa640, 0xa65f, + 0xa662, 0xa66e, + 0xa67f, 0xa697, + 0xa6a0, 0xa6ef, + 0xa717, 0xa71f, + 0xa722, 0xa788, + 0xa78b, 0xa78c, + 0xa7fb, 0xa801, + 0xa803, 0xa805, + 0xa807, 0xa80a, + 0xa80c, 0xa822, + 0xa840, 0xa873, + 0xa882, 0xa8b3, + 0xa8f2, 0xa8f7, + 0xa8fb, 0xa8fb, + 0xa90a, 0xa925, + 0xa930, 0xa946, + 0xa960, 0xa97c, + 0xa984, 0xa9b2, + 0xa9cf, 0xa9cf, + 0xaa00, 0xaa28, + 0xaa40, 0xaa42, + 0xaa44, 0xaa4b, + 0xaa60, 0xaa76, + 0xaa7a, 0xaa7a, + 0xaa80, 0xaaaf, + 0xaab1, 0xaab1, + 0xaab5, 0xaab6, + 0xaab9, 0xaabd, + 0xaac0, 0xaac0, + 0xaac2, 0xaac2, + 0xaadb, 0xaadd, + 0xabc0, 0xabe2, + 0xac00, 0xd7a3, + 0xd7b0, 0xd7c6, + 0xd7cb, 0xd7fb, + 0xf900, 0xfa2d, + 0xfa30, 0xfa6d, + 0xfa70, 0xfad9, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xfb1d, 0xfb1d, + 0xfb1f, 0xfb28, + 0xfb2a, 0xfb36, + 0xfb38, 0xfb3c, + 0xfb3e, 0xfb3e, + 0xfb40, 0xfb41, + 0xfb43, 0xfb44, + 0xfb46, 0xfbb1, + 0xfbd3, 0xfd3d, + 0xfd50, 0xfd8f, + 0xfd92, 0xfdc7, + 0xfdf0, 0xfdfb, + 0xfe70, 0xfe74, + 0xfe76, 0xfefc, + 0xff21, 0xff3a, + 0xff41, 0xff5a, + 0xff66, 0xffbe, + 0xffc2, 0xffc7, + 0xffca, 0xffcf, + 0xffd2, 0xffd7, + 0xffda, 0xffdc, + 0x10000, 0x1000b, + 0x1000d, 0x10026, + 0x10028, 0x1003a, + 0x1003c, 0x1003d, + 0x1003f, 0x1004d, + 0x10050, 0x1005d, + 0x10080, 0x100fa, + 0x10140, 0x10174, + 0x10280, 0x1029c, + 0x102a0, 0x102d0, + 0x10300, 0x1031e, + 0x10330, 0x1034a, + 0x10380, 0x1039d, + 0x103a0, 0x103c3, + 0x103c8, 0x103cf, + 0x103d1, 0x103d5, + 0x10400, 0x1049d, + 0x10800, 0x10805, + 0x10808, 0x10808, + 0x1080a, 0x10835, + 0x10837, 0x10838, + 0x1083c, 0x1083c, + 0x1083f, 0x10855, + 0x10900, 0x10915, + 0x10920, 0x10939, + 0x10a00, 0x10a00, + 0x10a10, 0x10a13, + 0x10a15, 0x10a17, + 0x10a19, 0x10a33, + 0x10a60, 0x10a7c, + 0x10b00, 0x10b35, + 0x10b40, 0x10b55, + 0x10b60, 0x10b72, + 0x10c00, 0x10c48, + 0x11083, 0x110af, + 0x12000, 0x1236e, + 0x12400, 0x12462, + 0x13000, 0x1342e, + 0x1d400, 0x1d454, + 0x1d456, 0x1d49c, + 0x1d49e, 0x1d49f, + 0x1d4a2, 0x1d4a2, + 0x1d4a5, 0x1d4a6, + 0x1d4a9, 0x1d4ac, + 0x1d4ae, 0x1d4b9, + 0x1d4bb, 0x1d4bb, + 0x1d4bd, 0x1d4c3, + 0x1d4c5, 0x1d505, + 0x1d507, 0x1d50a, + 0x1d50d, 0x1d514, + 0x1d516, 0x1d51c, + 0x1d51e, 0x1d539, + 0x1d53b, 0x1d53e, + 0x1d540, 0x1d544, + 0x1d546, 0x1d546, + 0x1d54a, 0x1d550, + 0x1d552, 0x1d6a5, + 0x1d6a8, 0x1d6c0, + 0x1d6c2, 0x1d6da, + 0x1d6dc, 0x1d6fa, + 0x1d6fc, 0x1d714, + 0x1d716, 0x1d734, + 0x1d736, 0x1d74e, + 0x1d750, 0x1d76e, + 0x1d770, 0x1d788, + 0x1d78a, 0x1d7a8, + 0x1d7aa, 0x1d7c2, + 0x1d7c4, 0x1d7cb, + 0x20000, 0x2a6d6, + 0x2a700, 0x2b734, + 0x2f800, 0x2fa1d, +}; /* CR_ID_Start */ + +/* 'ID_Continue': Derived Property */ +static const OnigCodePoint CR_ID_Continue[] = { + 506, + 0x0030, 0x0039, + 0x0041, 0x005a, + 0x005f, 0x005f, + 0x0061, 0x007a, + 0x00aa, 0x00aa, + 0x00b5, 0x00b5, + 0x00b7, 0x00b7, + 0x00ba, 0x00ba, + 0x00c0, 0x00d6, + 0x00d8, 0x00f6, + 0x00f8, 0x02c1, + 0x02c6, 0x02d1, + 0x02e0, 0x02e4, + 0x02ec, 0x02ec, + 0x02ee, 0x02ee, + 0x0300, 0x0374, + 0x0376, 0x0377, + 0x037a, 0x037d, + 0x0386, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x03a1, + 0x03a3, 0x03f5, + 0x03f7, 0x0481, + 0x0483, 0x0487, + 0x048a, 0x0525, + 0x0531, 0x0556, + 0x0559, 0x0559, + 0x0561, 0x0587, + 0x0591, 0x05bd, + 0x05bf, 0x05bf, + 0x05c1, 0x05c2, + 0x05c4, 0x05c5, + 0x05c7, 0x05c7, + 0x05d0, 0x05ea, + 0x05f0, 0x05f2, + 0x0610, 0x061a, + 0x0621, 0x065e, + 0x0660, 0x0669, + 0x066e, 0x06d3, + 0x06d5, 0x06dc, + 0x06df, 0x06e8, + 0x06ea, 0x06fc, + 0x06ff, 0x06ff, + 0x0710, 0x074a, + 0x074d, 0x07b1, + 0x07c0, 0x07f5, + 0x07fa, 0x07fa, + 0x0800, 0x082d, + 0x0900, 0x0939, + 0x093c, 0x094e, + 0x0950, 0x0955, + 0x0958, 0x0963, + 0x0966, 0x096f, + 0x0971, 0x0972, + 0x0979, 0x097f, + 0x0981, 0x0983, + 0x0985, 0x098c, + 0x098f, 0x0990, + 0x0993, 0x09a8, + 0x09aa, 0x09b0, + 0x09b2, 0x09b2, + 0x09b6, 0x09b9, + 0x09bc, 0x09c4, + 0x09c7, 0x09c8, + 0x09cb, 0x09ce, + 0x09d7, 0x09d7, + 0x09dc, 0x09dd, + 0x09df, 0x09e3, + 0x09e6, 0x09f1, + 0x0a01, 0x0a03, + 0x0a05, 0x0a0a, + 0x0a0f, 0x0a10, + 0x0a13, 0x0a28, + 0x0a2a, 0x0a30, + 0x0a32, 0x0a33, + 0x0a35, 0x0a36, + 0x0a38, 0x0a39, + 0x0a3c, 0x0a3c, + 0x0a3e, 0x0a42, + 0x0a47, 0x0a48, + 0x0a4b, 0x0a4d, + 0x0a51, 0x0a51, + 0x0a59, 0x0a5c, + 0x0a5e, 0x0a5e, + 0x0a66, 0x0a75, + 0x0a81, 0x0a83, + 0x0a85, 0x0a8d, + 0x0a8f, 0x0a91, + 0x0a93, 0x0aa8, + 0x0aaa, 0x0ab0, + 0x0ab2, 0x0ab3, + 0x0ab5, 0x0ab9, + 0x0abc, 0x0ac5, + 0x0ac7, 0x0ac9, + 0x0acb, 0x0acd, + 0x0ad0, 0x0ad0, + 0x0ae0, 0x0ae3, + 0x0ae6, 0x0aef, + 0x0b01, 0x0b03, + 0x0b05, 0x0b0c, + 0x0b0f, 0x0b10, + 0x0b13, 0x0b28, + 0x0b2a, 0x0b30, + 0x0b32, 0x0b33, + 0x0b35, 0x0b39, + 0x0b3c, 0x0b44, + 0x0b47, 0x0b48, + 0x0b4b, 0x0b4d, + 0x0b56, 0x0b57, + 0x0b5c, 0x0b5d, + 0x0b5f, 0x0b63, + 0x0b66, 0x0b6f, + 0x0b71, 0x0b71, + 0x0b82, 0x0b83, + 0x0b85, 0x0b8a, + 0x0b8e, 0x0b90, + 0x0b92, 0x0b95, + 0x0b99, 0x0b9a, + 0x0b9c, 0x0b9c, + 0x0b9e, 0x0b9f, + 0x0ba3, 0x0ba4, + 0x0ba8, 0x0baa, + 0x0bae, 0x0bb9, + 0x0bbe, 0x0bc2, + 0x0bc6, 0x0bc8, + 0x0bca, 0x0bcd, + 0x0bd0, 0x0bd0, + 0x0bd7, 0x0bd7, + 0x0be6, 0x0bef, + 0x0c01, 0x0c03, + 0x0c05, 0x0c0c, + 0x0c0e, 0x0c10, + 0x0c12, 0x0c28, + 0x0c2a, 0x0c33, + 0x0c35, 0x0c39, + 0x0c3d, 0x0c44, + 0x0c46, 0x0c48, + 0x0c4a, 0x0c4d, + 0x0c55, 0x0c56, + 0x0c58, 0x0c59, + 0x0c60, 0x0c63, + 0x0c66, 0x0c6f, + 0x0c82, 0x0c83, + 0x0c85, 0x0c8c, + 0x0c8e, 0x0c90, + 0x0c92, 0x0ca8, + 0x0caa, 0x0cb3, + 0x0cb5, 0x0cb9, + 0x0cbc, 0x0cc4, + 0x0cc6, 0x0cc8, + 0x0cca, 0x0ccd, + 0x0cd5, 0x0cd6, + 0x0cde, 0x0cde, + 0x0ce0, 0x0ce3, + 0x0ce6, 0x0cef, + 0x0d02, 0x0d03, + 0x0d05, 0x0d0c, + 0x0d0e, 0x0d10, + 0x0d12, 0x0d28, + 0x0d2a, 0x0d39, + 0x0d3d, 0x0d44, + 0x0d46, 0x0d48, + 0x0d4a, 0x0d4d, + 0x0d57, 0x0d57, + 0x0d60, 0x0d63, + 0x0d66, 0x0d6f, + 0x0d7a, 0x0d7f, + 0x0d82, 0x0d83, + 0x0d85, 0x0d96, + 0x0d9a, 0x0db1, + 0x0db3, 0x0dbb, + 0x0dbd, 0x0dbd, + 0x0dc0, 0x0dc6, + 0x0dca, 0x0dca, + 0x0dcf, 0x0dd4, + 0x0dd6, 0x0dd6, + 0x0dd8, 0x0ddf, + 0x0df2, 0x0df3, + 0x0e01, 0x0e3a, + 0x0e40, 0x0e4e, + 0x0e50, 0x0e59, + 0x0e81, 0x0e82, + 0x0e84, 0x0e84, + 0x0e87, 0x0e88, + 0x0e8a, 0x0e8a, + 0x0e8d, 0x0e8d, + 0x0e94, 0x0e97, + 0x0e99, 0x0e9f, + 0x0ea1, 0x0ea3, + 0x0ea5, 0x0ea5, + 0x0ea7, 0x0ea7, + 0x0eaa, 0x0eab, + 0x0ead, 0x0eb9, + 0x0ebb, 0x0ebd, + 0x0ec0, 0x0ec4, + 0x0ec6, 0x0ec6, + 0x0ec8, 0x0ecd, + 0x0ed0, 0x0ed9, + 0x0edc, 0x0edd, + 0x0f00, 0x0f00, + 0x0f18, 0x0f19, + 0x0f20, 0x0f29, + 0x0f35, 0x0f35, + 0x0f37, 0x0f37, + 0x0f39, 0x0f39, + 0x0f3e, 0x0f47, + 0x0f49, 0x0f6c, + 0x0f71, 0x0f84, + 0x0f86, 0x0f8b, + 0x0f90, 0x0f97, + 0x0f99, 0x0fbc, + 0x0fc6, 0x0fc6, + 0x1000, 0x1049, + 0x1050, 0x109d, + 0x10a0, 0x10c5, + 0x10d0, 0x10fa, + 0x10fc, 0x10fc, + 0x1100, 0x1248, + 0x124a, 0x124d, + 0x1250, 0x1256, + 0x1258, 0x1258, + 0x125a, 0x125d, + 0x1260, 0x1288, + 0x128a, 0x128d, + 0x1290, 0x12b0, + 0x12b2, 0x12b5, + 0x12b8, 0x12be, + 0x12c0, 0x12c0, + 0x12c2, 0x12c5, + 0x12c8, 0x12d6, + 0x12d8, 0x1310, + 0x1312, 0x1315, + 0x1318, 0x135a, + 0x135f, 0x135f, + 0x1369, 0x1371, + 0x1380, 0x138f, + 0x13a0, 0x13f4, + 0x1401, 0x166c, + 0x166f, 0x167f, + 0x1681, 0x169a, + 0x16a0, 0x16ea, + 0x16ee, 0x16f0, + 0x1700, 0x170c, + 0x170e, 0x1714, + 0x1720, 0x1734, + 0x1740, 0x1753, + 0x1760, 0x176c, + 0x176e, 0x1770, + 0x1772, 0x1773, + 0x1780, 0x17b3, + 0x17b6, 0x17d3, + 0x17d7, 0x17d7, + 0x17dc, 0x17dd, + 0x17e0, 0x17e9, + 0x180b, 0x180d, + 0x1810, 0x1819, + 0x1820, 0x1877, + 0x1880, 0x18aa, + 0x18b0, 0x18f5, + 0x1900, 0x191c, + 0x1920, 0x192b, + 0x1930, 0x193b, + 0x1946, 0x196d, + 0x1970, 0x1974, + 0x1980, 0x19ab, + 0x19b0, 0x19c9, + 0x19d0, 0x19da, + 0x1a00, 0x1a1b, + 0x1a20, 0x1a5e, + 0x1a60, 0x1a7c, + 0x1a7f, 0x1a89, + 0x1a90, 0x1a99, + 0x1aa7, 0x1aa7, + 0x1b00, 0x1b4b, + 0x1b50, 0x1b59, + 0x1b6b, 0x1b73, + 0x1b80, 0x1baa, + 0x1bae, 0x1bb9, + 0x1c00, 0x1c37, + 0x1c40, 0x1c49, + 0x1c4d, 0x1c7d, + 0x1cd0, 0x1cd2, + 0x1cd4, 0x1cf2, + 0x1d00, 0x1de6, + 0x1dfd, 0x1f15, + 0x1f18, 0x1f1d, + 0x1f20, 0x1f45, + 0x1f48, 0x1f4d, + 0x1f50, 0x1f57, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f7d, + 0x1f80, 0x1fb4, + 0x1fb6, 0x1fbc, + 0x1fbe, 0x1fbe, + 0x1fc2, 0x1fc4, + 0x1fc6, 0x1fcc, + 0x1fd0, 0x1fd3, + 0x1fd6, 0x1fdb, + 0x1fe0, 0x1fec, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ffc, + 0x203f, 0x2040, + 0x2054, 0x2054, + 0x2071, 0x2071, + 0x207f, 0x207f, + 0x2090, 0x2094, + 0x20d0, 0x20dc, + 0x20e1, 0x20e1, + 0x20e5, 0x20f0, + 0x2102, 0x2102, + 0x2107, 0x2107, + 0x210a, 0x2113, + 0x2115, 0x2115, + 0x2118, 0x211d, + 0x2124, 0x2124, + 0x2126, 0x2126, + 0x2128, 0x2128, + 0x212a, 0x2139, + 0x213c, 0x213f, + 0x2145, 0x2149, + 0x214e, 0x214e, + 0x2160, 0x2188, + 0x2c00, 0x2c2e, + 0x2c30, 0x2c5e, + 0x2c60, 0x2ce4, + 0x2ceb, 0x2cf1, + 0x2d00, 0x2d25, + 0x2d30, 0x2d65, + 0x2d6f, 0x2d6f, + 0x2d80, 0x2d96, + 0x2da0, 0x2da6, + 0x2da8, 0x2dae, + 0x2db0, 0x2db6, + 0x2db8, 0x2dbe, + 0x2dc0, 0x2dc6, + 0x2dc8, 0x2dce, + 0x2dd0, 0x2dd6, + 0x2dd8, 0x2dde, + 0x2de0, 0x2dff, + 0x3005, 0x3007, + 0x3021, 0x302f, + 0x3031, 0x3035, + 0x3038, 0x303c, + 0x3041, 0x3096, + 0x3099, 0x309f, + 0x30a1, 0x30fa, + 0x30fc, 0x30ff, + 0x3105, 0x312d, + 0x3131, 0x318e, + 0x31a0, 0x31b7, + 0x31f0, 0x31ff, + 0x3400, 0x4db5, + 0x4e00, 0x9fcb, + 0xa000, 0xa48c, + 0xa4d0, 0xa4fd, + 0xa500, 0xa60c, + 0xa610, 0xa62b, + 0xa640, 0xa65f, + 0xa662, 0xa66f, + 0xa67c, 0xa67d, + 0xa67f, 0xa697, + 0xa6a0, 0xa6f1, + 0xa717, 0xa71f, + 0xa722, 0xa788, + 0xa78b, 0xa78c, + 0xa7fb, 0xa827, + 0xa840, 0xa873, + 0xa880, 0xa8c4, + 0xa8d0, 0xa8d9, + 0xa8e0, 0xa8f7, + 0xa8fb, 0xa8fb, + 0xa900, 0xa92d, + 0xa930, 0xa953, + 0xa960, 0xa97c, + 0xa980, 0xa9c0, + 0xa9cf, 0xa9d9, + 0xaa00, 0xaa36, + 0xaa40, 0xaa4d, + 0xaa50, 0xaa59, + 0xaa60, 0xaa76, + 0xaa7a, 0xaa7b, + 0xaa80, 0xaac2, + 0xaadb, 0xaadd, + 0xabc0, 0xabea, + 0xabec, 0xabed, + 0xabf0, 0xabf9, + 0xac00, 0xd7a3, + 0xd7b0, 0xd7c6, + 0xd7cb, 0xd7fb, + 0xf900, 0xfa2d, + 0xfa30, 0xfa6d, + 0xfa70, 0xfad9, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xfb1d, 0xfb28, + 0xfb2a, 0xfb36, + 0xfb38, 0xfb3c, + 0xfb3e, 0xfb3e, + 0xfb40, 0xfb41, + 0xfb43, 0xfb44, + 0xfb46, 0xfbb1, + 0xfbd3, 0xfd3d, + 0xfd50, 0xfd8f, + 0xfd92, 0xfdc7, + 0xfdf0, 0xfdfb, + 0xfe00, 0xfe0f, + 0xfe20, 0xfe26, + 0xfe33, 0xfe34, + 0xfe4d, 0xfe4f, + 0xfe70, 0xfe74, + 0xfe76, 0xfefc, + 0xff10, 0xff19, + 0xff21, 0xff3a, + 0xff3f, 0xff3f, + 0xff41, 0xff5a, + 0xff66, 0xffbe, + 0xffc2, 0xffc7, + 0xffca, 0xffcf, + 0xffd2, 0xffd7, + 0xffda, 0xffdc, + 0x10000, 0x1000b, + 0x1000d, 0x10026, + 0x10028, 0x1003a, + 0x1003c, 0x1003d, + 0x1003f, 0x1004d, + 0x10050, 0x1005d, + 0x10080, 0x100fa, + 0x10140, 0x10174, + 0x101fd, 0x101fd, + 0x10280, 0x1029c, + 0x102a0, 0x102d0, + 0x10300, 0x1031e, + 0x10330, 0x1034a, + 0x10380, 0x1039d, + 0x103a0, 0x103c3, + 0x103c8, 0x103cf, + 0x103d1, 0x103d5, + 0x10400, 0x1049d, + 0x104a0, 0x104a9, + 0x10800, 0x10805, + 0x10808, 0x10808, + 0x1080a, 0x10835, + 0x10837, 0x10838, + 0x1083c, 0x1083c, + 0x1083f, 0x10855, + 0x10900, 0x10915, + 0x10920, 0x10939, + 0x10a00, 0x10a03, + 0x10a05, 0x10a06, + 0x10a0c, 0x10a13, + 0x10a15, 0x10a17, + 0x10a19, 0x10a33, + 0x10a38, 0x10a3a, + 0x10a3f, 0x10a3f, + 0x10a60, 0x10a7c, + 0x10b00, 0x10b35, + 0x10b40, 0x10b55, + 0x10b60, 0x10b72, + 0x10c00, 0x10c48, + 0x11080, 0x110ba, + 0x12000, 0x1236e, + 0x12400, 0x12462, + 0x13000, 0x1342e, + 0x1d165, 0x1d169, + 0x1d16d, 0x1d172, + 0x1d17b, 0x1d182, + 0x1d185, 0x1d18b, + 0x1d1aa, 0x1d1ad, + 0x1d242, 0x1d244, + 0x1d400, 0x1d454, + 0x1d456, 0x1d49c, + 0x1d49e, 0x1d49f, + 0x1d4a2, 0x1d4a2, + 0x1d4a5, 0x1d4a6, + 0x1d4a9, 0x1d4ac, + 0x1d4ae, 0x1d4b9, + 0x1d4bb, 0x1d4bb, + 0x1d4bd, 0x1d4c3, + 0x1d4c5, 0x1d505, + 0x1d507, 0x1d50a, + 0x1d50d, 0x1d514, + 0x1d516, 0x1d51c, + 0x1d51e, 0x1d539, + 0x1d53b, 0x1d53e, + 0x1d540, 0x1d544, + 0x1d546, 0x1d546, + 0x1d54a, 0x1d550, + 0x1d552, 0x1d6a5, + 0x1d6a8, 0x1d6c0, + 0x1d6c2, 0x1d6da, + 0x1d6dc, 0x1d6fa, + 0x1d6fc, 0x1d714, + 0x1d716, 0x1d734, + 0x1d736, 0x1d74e, + 0x1d750, 0x1d76e, + 0x1d770, 0x1d788, + 0x1d78a, 0x1d7a8, + 0x1d7aa, 0x1d7c2, + 0x1d7c4, 0x1d7cb, + 0x1d7ce, 0x1d7ff, + 0x20000, 0x2a6d6, + 0x2a700, 0x2b734, + 0x2f800, 0x2fa1d, + 0xe0100, 0xe01ef, +}; /* CR_ID_Continue */ + +/* 'XID_Start': Derived Property */ +static const OnigCodePoint CR_XID_Start[] = { + 431, + 0x0041, 0x005a, + 0x0061, 0x007a, + 0x00aa, 0x00aa, + 0x00b5, 0x00b5, + 0x00ba, 0x00ba, + 0x00c0, 0x00d6, + 0x00d8, 0x00f6, + 0x00f8, 0x02c1, + 0x02c6, 0x02d1, + 0x02e0, 0x02e4, + 0x02ec, 0x02ec, + 0x02ee, 0x02ee, + 0x0370, 0x0374, + 0x0376, 0x0377, + 0x037b, 0x037d, + 0x0386, 0x0386, + 0x0388, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x03a1, + 0x03a3, 0x03f5, + 0x03f7, 0x0481, + 0x048a, 0x0525, + 0x0531, 0x0556, + 0x0559, 0x0559, + 0x0561, 0x0587, + 0x05d0, 0x05ea, + 0x05f0, 0x05f2, + 0x0621, 0x064a, + 0x066e, 0x066f, + 0x0671, 0x06d3, + 0x06d5, 0x06d5, + 0x06e5, 0x06e6, + 0x06ee, 0x06ef, + 0x06fa, 0x06fc, + 0x06ff, 0x06ff, + 0x0710, 0x0710, + 0x0712, 0x072f, + 0x074d, 0x07a5, + 0x07b1, 0x07b1, + 0x07ca, 0x07ea, + 0x07f4, 0x07f5, + 0x07fa, 0x07fa, + 0x0800, 0x0815, + 0x081a, 0x081a, + 0x0824, 0x0824, + 0x0828, 0x0828, + 0x0904, 0x0939, + 0x093d, 0x093d, + 0x0950, 0x0950, + 0x0958, 0x0961, + 0x0971, 0x0972, + 0x0979, 0x097f, + 0x0985, 0x098c, + 0x098f, 0x0990, + 0x0993, 0x09a8, + 0x09aa, 0x09b0, + 0x09b2, 0x09b2, + 0x09b6, 0x09b9, + 0x09bd, 0x09bd, + 0x09ce, 0x09ce, + 0x09dc, 0x09dd, + 0x09df, 0x09e1, + 0x09f0, 0x09f1, + 0x0a05, 0x0a0a, + 0x0a0f, 0x0a10, + 0x0a13, 0x0a28, + 0x0a2a, 0x0a30, + 0x0a32, 0x0a33, + 0x0a35, 0x0a36, + 0x0a38, 0x0a39, + 0x0a59, 0x0a5c, + 0x0a5e, 0x0a5e, + 0x0a72, 0x0a74, + 0x0a85, 0x0a8d, + 0x0a8f, 0x0a91, + 0x0a93, 0x0aa8, + 0x0aaa, 0x0ab0, + 0x0ab2, 0x0ab3, + 0x0ab5, 0x0ab9, + 0x0abd, 0x0abd, + 0x0ad0, 0x0ad0, + 0x0ae0, 0x0ae1, + 0x0b05, 0x0b0c, + 0x0b0f, 0x0b10, + 0x0b13, 0x0b28, + 0x0b2a, 0x0b30, + 0x0b32, 0x0b33, + 0x0b35, 0x0b39, + 0x0b3d, 0x0b3d, + 0x0b5c, 0x0b5d, + 0x0b5f, 0x0b61, + 0x0b71, 0x0b71, + 0x0b83, 0x0b83, + 0x0b85, 0x0b8a, + 0x0b8e, 0x0b90, + 0x0b92, 0x0b95, + 0x0b99, 0x0b9a, + 0x0b9c, 0x0b9c, + 0x0b9e, 0x0b9f, + 0x0ba3, 0x0ba4, + 0x0ba8, 0x0baa, + 0x0bae, 0x0bb9, + 0x0bd0, 0x0bd0, + 0x0c05, 0x0c0c, + 0x0c0e, 0x0c10, + 0x0c12, 0x0c28, + 0x0c2a, 0x0c33, + 0x0c35, 0x0c39, + 0x0c3d, 0x0c3d, + 0x0c58, 0x0c59, + 0x0c60, 0x0c61, + 0x0c85, 0x0c8c, + 0x0c8e, 0x0c90, + 0x0c92, 0x0ca8, + 0x0caa, 0x0cb3, + 0x0cb5, 0x0cb9, + 0x0cbd, 0x0cbd, + 0x0cde, 0x0cde, + 0x0ce0, 0x0ce1, + 0x0d05, 0x0d0c, + 0x0d0e, 0x0d10, + 0x0d12, 0x0d28, + 0x0d2a, 0x0d39, + 0x0d3d, 0x0d3d, + 0x0d60, 0x0d61, + 0x0d7a, 0x0d7f, + 0x0d85, 0x0d96, + 0x0d9a, 0x0db1, + 0x0db3, 0x0dbb, + 0x0dbd, 0x0dbd, + 0x0dc0, 0x0dc6, + 0x0e01, 0x0e30, + 0x0e32, 0x0e32, + 0x0e40, 0x0e46, + 0x0e81, 0x0e82, + 0x0e84, 0x0e84, + 0x0e87, 0x0e88, + 0x0e8a, 0x0e8a, + 0x0e8d, 0x0e8d, + 0x0e94, 0x0e97, + 0x0e99, 0x0e9f, + 0x0ea1, 0x0ea3, + 0x0ea5, 0x0ea5, + 0x0ea7, 0x0ea7, + 0x0eaa, 0x0eab, + 0x0ead, 0x0eb0, + 0x0eb2, 0x0eb2, + 0x0ebd, 0x0ebd, + 0x0ec0, 0x0ec4, + 0x0ec6, 0x0ec6, + 0x0edc, 0x0edd, + 0x0f00, 0x0f00, + 0x0f40, 0x0f47, + 0x0f49, 0x0f6c, + 0x0f88, 0x0f8b, + 0x1000, 0x102a, + 0x103f, 0x103f, + 0x1050, 0x1055, + 0x105a, 0x105d, + 0x1061, 0x1061, + 0x1065, 0x1066, + 0x106e, 0x1070, + 0x1075, 0x1081, + 0x108e, 0x108e, + 0x10a0, 0x10c5, + 0x10d0, 0x10fa, + 0x10fc, 0x10fc, + 0x1100, 0x1248, + 0x124a, 0x124d, + 0x1250, 0x1256, + 0x1258, 0x1258, + 0x125a, 0x125d, + 0x1260, 0x1288, + 0x128a, 0x128d, + 0x1290, 0x12b0, + 0x12b2, 0x12b5, + 0x12b8, 0x12be, + 0x12c0, 0x12c0, + 0x12c2, 0x12c5, + 0x12c8, 0x12d6, + 0x12d8, 0x1310, + 0x1312, 0x1315, + 0x1318, 0x135a, + 0x1380, 0x138f, + 0x13a0, 0x13f4, + 0x1401, 0x166c, + 0x166f, 0x167f, + 0x1681, 0x169a, + 0x16a0, 0x16ea, + 0x16ee, 0x16f0, + 0x1700, 0x170c, + 0x170e, 0x1711, + 0x1720, 0x1731, + 0x1740, 0x1751, + 0x1760, 0x176c, + 0x176e, 0x1770, + 0x1780, 0x17b3, + 0x17d7, 0x17d7, + 0x17dc, 0x17dc, + 0x1820, 0x1877, + 0x1880, 0x18a8, + 0x18aa, 0x18aa, + 0x18b0, 0x18f5, + 0x1900, 0x191c, + 0x1950, 0x196d, + 0x1970, 0x1974, + 0x1980, 0x19ab, + 0x19c1, 0x19c7, + 0x1a00, 0x1a16, + 0x1a20, 0x1a54, + 0x1aa7, 0x1aa7, + 0x1b05, 0x1b33, + 0x1b45, 0x1b4b, + 0x1b83, 0x1ba0, + 0x1bae, 0x1baf, + 0x1c00, 0x1c23, + 0x1c4d, 0x1c4f, + 0x1c5a, 0x1c7d, + 0x1ce9, 0x1cec, + 0x1cee, 0x1cf1, + 0x1d00, 0x1dbf, + 0x1e00, 0x1f15, + 0x1f18, 0x1f1d, + 0x1f20, 0x1f45, + 0x1f48, 0x1f4d, + 0x1f50, 0x1f57, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f7d, + 0x1f80, 0x1fb4, + 0x1fb6, 0x1fbc, + 0x1fbe, 0x1fbe, + 0x1fc2, 0x1fc4, + 0x1fc6, 0x1fcc, + 0x1fd0, 0x1fd3, + 0x1fd6, 0x1fdb, + 0x1fe0, 0x1fec, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ffc, + 0x2071, 0x2071, + 0x207f, 0x207f, + 0x2090, 0x2094, + 0x2102, 0x2102, + 0x2107, 0x2107, + 0x210a, 0x2113, + 0x2115, 0x2115, + 0x2118, 0x211d, + 0x2124, 0x2124, + 0x2126, 0x2126, + 0x2128, 0x2128, + 0x212a, 0x2139, + 0x213c, 0x213f, + 0x2145, 0x2149, + 0x214e, 0x214e, + 0x2160, 0x2188, + 0x2c00, 0x2c2e, + 0x2c30, 0x2c5e, + 0x2c60, 0x2ce4, + 0x2ceb, 0x2cee, + 0x2d00, 0x2d25, + 0x2d30, 0x2d65, + 0x2d6f, 0x2d6f, + 0x2d80, 0x2d96, + 0x2da0, 0x2da6, + 0x2da8, 0x2dae, + 0x2db0, 0x2db6, + 0x2db8, 0x2dbe, + 0x2dc0, 0x2dc6, + 0x2dc8, 0x2dce, + 0x2dd0, 0x2dd6, + 0x2dd8, 0x2dde, + 0x3005, 0x3007, + 0x3021, 0x3029, + 0x3031, 0x3035, + 0x3038, 0x303c, + 0x3041, 0x3096, + 0x309d, 0x309f, + 0x30a1, 0x30fa, + 0x30fc, 0x30ff, + 0x3105, 0x312d, + 0x3131, 0x318e, + 0x31a0, 0x31b7, + 0x31f0, 0x31ff, + 0x3400, 0x4db5, + 0x4e00, 0x9fcb, + 0xa000, 0xa48c, + 0xa4d0, 0xa4fd, + 0xa500, 0xa60c, + 0xa610, 0xa61f, + 0xa62a, 0xa62b, + 0xa640, 0xa65f, + 0xa662, 0xa66e, + 0xa67f, 0xa697, + 0xa6a0, 0xa6ef, + 0xa717, 0xa71f, + 0xa722, 0xa788, + 0xa78b, 0xa78c, + 0xa7fb, 0xa801, + 0xa803, 0xa805, + 0xa807, 0xa80a, + 0xa80c, 0xa822, + 0xa840, 0xa873, + 0xa882, 0xa8b3, + 0xa8f2, 0xa8f7, + 0xa8fb, 0xa8fb, + 0xa90a, 0xa925, + 0xa930, 0xa946, + 0xa960, 0xa97c, + 0xa984, 0xa9b2, + 0xa9cf, 0xa9cf, + 0xaa00, 0xaa28, + 0xaa40, 0xaa42, + 0xaa44, 0xaa4b, + 0xaa60, 0xaa76, + 0xaa7a, 0xaa7a, + 0xaa80, 0xaaaf, + 0xaab1, 0xaab1, + 0xaab5, 0xaab6, + 0xaab9, 0xaabd, + 0xaac0, 0xaac0, + 0xaac2, 0xaac2, + 0xaadb, 0xaadd, + 0xabc0, 0xabe2, + 0xac00, 0xd7a3, + 0xd7b0, 0xd7c6, + 0xd7cb, 0xd7fb, + 0xf900, 0xfa2d, + 0xfa30, 0xfa6d, + 0xfa70, 0xfad9, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xfb1d, 0xfb1d, + 0xfb1f, 0xfb28, + 0xfb2a, 0xfb36, + 0xfb38, 0xfb3c, + 0xfb3e, 0xfb3e, + 0xfb40, 0xfb41, + 0xfb43, 0xfb44, + 0xfb46, 0xfbb1, + 0xfbd3, 0xfc5d, + 0xfc64, 0xfd3d, + 0xfd50, 0xfd8f, + 0xfd92, 0xfdc7, + 0xfdf0, 0xfdf9, + 0xfe71, 0xfe71, + 0xfe73, 0xfe73, + 0xfe77, 0xfe77, + 0xfe79, 0xfe79, + 0xfe7b, 0xfe7b, + 0xfe7d, 0xfe7d, + 0xfe7f, 0xfefc, + 0xff21, 0xff3a, + 0xff41, 0xff5a, + 0xff66, 0xff9d, + 0xffa0, 0xffbe, + 0xffc2, 0xffc7, + 0xffca, 0xffcf, + 0xffd2, 0xffd7, + 0xffda, 0xffdc, + 0x10000, 0x1000b, + 0x1000d, 0x10026, + 0x10028, 0x1003a, + 0x1003c, 0x1003d, + 0x1003f, 0x1004d, + 0x10050, 0x1005d, + 0x10080, 0x100fa, + 0x10140, 0x10174, + 0x10280, 0x1029c, + 0x102a0, 0x102d0, + 0x10300, 0x1031e, + 0x10330, 0x1034a, + 0x10380, 0x1039d, + 0x103a0, 0x103c3, + 0x103c8, 0x103cf, + 0x103d1, 0x103d5, + 0x10400, 0x1049d, + 0x10800, 0x10805, + 0x10808, 0x10808, + 0x1080a, 0x10835, + 0x10837, 0x10838, + 0x1083c, 0x1083c, + 0x1083f, 0x10855, + 0x10900, 0x10915, + 0x10920, 0x10939, + 0x10a00, 0x10a00, + 0x10a10, 0x10a13, + 0x10a15, 0x10a17, + 0x10a19, 0x10a33, + 0x10a60, 0x10a7c, + 0x10b00, 0x10b35, + 0x10b40, 0x10b55, + 0x10b60, 0x10b72, + 0x10c00, 0x10c48, + 0x11083, 0x110af, + 0x12000, 0x1236e, + 0x12400, 0x12462, + 0x13000, 0x1342e, + 0x1d400, 0x1d454, + 0x1d456, 0x1d49c, + 0x1d49e, 0x1d49f, + 0x1d4a2, 0x1d4a2, + 0x1d4a5, 0x1d4a6, + 0x1d4a9, 0x1d4ac, + 0x1d4ae, 0x1d4b9, + 0x1d4bb, 0x1d4bb, + 0x1d4bd, 0x1d4c3, + 0x1d4c5, 0x1d505, + 0x1d507, 0x1d50a, + 0x1d50d, 0x1d514, + 0x1d516, 0x1d51c, + 0x1d51e, 0x1d539, + 0x1d53b, 0x1d53e, + 0x1d540, 0x1d544, + 0x1d546, 0x1d546, + 0x1d54a, 0x1d550, + 0x1d552, 0x1d6a5, + 0x1d6a8, 0x1d6c0, + 0x1d6c2, 0x1d6da, + 0x1d6dc, 0x1d6fa, + 0x1d6fc, 0x1d714, + 0x1d716, 0x1d734, + 0x1d736, 0x1d74e, + 0x1d750, 0x1d76e, + 0x1d770, 0x1d788, + 0x1d78a, 0x1d7a8, + 0x1d7aa, 0x1d7c2, + 0x1d7c4, 0x1d7cb, + 0x20000, 0x2a6d6, + 0x2a700, 0x2b734, + 0x2f800, 0x2fa1d, +}; /* CR_XID_Start */ + +/* 'XID_Continue': Derived Property */ +static const OnigCodePoint CR_XID_Continue[] = { + 513, + 0x0030, 0x0039, + 0x0041, 0x005a, + 0x005f, 0x005f, + 0x0061, 0x007a, + 0x00aa, 0x00aa, + 0x00b5, 0x00b5, + 0x00b7, 0x00b7, + 0x00ba, 0x00ba, + 0x00c0, 0x00d6, + 0x00d8, 0x00f6, + 0x00f8, 0x02c1, + 0x02c6, 0x02d1, + 0x02e0, 0x02e4, + 0x02ec, 0x02ec, + 0x02ee, 0x02ee, + 0x0300, 0x0374, + 0x0376, 0x0377, + 0x037b, 0x037d, + 0x0386, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x03a1, + 0x03a3, 0x03f5, + 0x03f7, 0x0481, + 0x0483, 0x0487, + 0x048a, 0x0525, + 0x0531, 0x0556, + 0x0559, 0x0559, + 0x0561, 0x0587, + 0x0591, 0x05bd, + 0x05bf, 0x05bf, + 0x05c1, 0x05c2, + 0x05c4, 0x05c5, + 0x05c7, 0x05c7, + 0x05d0, 0x05ea, + 0x05f0, 0x05f2, + 0x0610, 0x061a, + 0x0621, 0x065e, + 0x0660, 0x0669, + 0x066e, 0x06d3, + 0x06d5, 0x06dc, + 0x06df, 0x06e8, + 0x06ea, 0x06fc, + 0x06ff, 0x06ff, + 0x0710, 0x074a, + 0x074d, 0x07b1, + 0x07c0, 0x07f5, + 0x07fa, 0x07fa, + 0x0800, 0x082d, + 0x0900, 0x0939, + 0x093c, 0x094e, + 0x0950, 0x0955, + 0x0958, 0x0963, + 0x0966, 0x096f, + 0x0971, 0x0972, + 0x0979, 0x097f, + 0x0981, 0x0983, + 0x0985, 0x098c, + 0x098f, 0x0990, + 0x0993, 0x09a8, + 0x09aa, 0x09b0, + 0x09b2, 0x09b2, + 0x09b6, 0x09b9, + 0x09bc, 0x09c4, + 0x09c7, 0x09c8, + 0x09cb, 0x09ce, + 0x09d7, 0x09d7, + 0x09dc, 0x09dd, + 0x09df, 0x09e3, + 0x09e6, 0x09f1, + 0x0a01, 0x0a03, + 0x0a05, 0x0a0a, + 0x0a0f, 0x0a10, + 0x0a13, 0x0a28, + 0x0a2a, 0x0a30, + 0x0a32, 0x0a33, + 0x0a35, 0x0a36, + 0x0a38, 0x0a39, + 0x0a3c, 0x0a3c, + 0x0a3e, 0x0a42, + 0x0a47, 0x0a48, + 0x0a4b, 0x0a4d, + 0x0a51, 0x0a51, + 0x0a59, 0x0a5c, + 0x0a5e, 0x0a5e, + 0x0a66, 0x0a75, + 0x0a81, 0x0a83, + 0x0a85, 0x0a8d, + 0x0a8f, 0x0a91, + 0x0a93, 0x0aa8, + 0x0aaa, 0x0ab0, + 0x0ab2, 0x0ab3, + 0x0ab5, 0x0ab9, + 0x0abc, 0x0ac5, + 0x0ac7, 0x0ac9, + 0x0acb, 0x0acd, + 0x0ad0, 0x0ad0, + 0x0ae0, 0x0ae3, + 0x0ae6, 0x0aef, + 0x0b01, 0x0b03, + 0x0b05, 0x0b0c, + 0x0b0f, 0x0b10, + 0x0b13, 0x0b28, + 0x0b2a, 0x0b30, + 0x0b32, 0x0b33, + 0x0b35, 0x0b39, + 0x0b3c, 0x0b44, + 0x0b47, 0x0b48, + 0x0b4b, 0x0b4d, + 0x0b56, 0x0b57, + 0x0b5c, 0x0b5d, + 0x0b5f, 0x0b63, + 0x0b66, 0x0b6f, + 0x0b71, 0x0b71, + 0x0b82, 0x0b83, + 0x0b85, 0x0b8a, + 0x0b8e, 0x0b90, + 0x0b92, 0x0b95, + 0x0b99, 0x0b9a, + 0x0b9c, 0x0b9c, + 0x0b9e, 0x0b9f, + 0x0ba3, 0x0ba4, + 0x0ba8, 0x0baa, + 0x0bae, 0x0bb9, + 0x0bbe, 0x0bc2, + 0x0bc6, 0x0bc8, + 0x0bca, 0x0bcd, + 0x0bd0, 0x0bd0, + 0x0bd7, 0x0bd7, + 0x0be6, 0x0bef, + 0x0c01, 0x0c03, + 0x0c05, 0x0c0c, + 0x0c0e, 0x0c10, + 0x0c12, 0x0c28, + 0x0c2a, 0x0c33, + 0x0c35, 0x0c39, + 0x0c3d, 0x0c44, + 0x0c46, 0x0c48, + 0x0c4a, 0x0c4d, + 0x0c55, 0x0c56, + 0x0c58, 0x0c59, + 0x0c60, 0x0c63, + 0x0c66, 0x0c6f, + 0x0c82, 0x0c83, + 0x0c85, 0x0c8c, + 0x0c8e, 0x0c90, + 0x0c92, 0x0ca8, + 0x0caa, 0x0cb3, + 0x0cb5, 0x0cb9, + 0x0cbc, 0x0cc4, + 0x0cc6, 0x0cc8, + 0x0cca, 0x0ccd, + 0x0cd5, 0x0cd6, + 0x0cde, 0x0cde, + 0x0ce0, 0x0ce3, + 0x0ce6, 0x0cef, + 0x0d02, 0x0d03, + 0x0d05, 0x0d0c, + 0x0d0e, 0x0d10, + 0x0d12, 0x0d28, + 0x0d2a, 0x0d39, + 0x0d3d, 0x0d44, + 0x0d46, 0x0d48, + 0x0d4a, 0x0d4d, + 0x0d57, 0x0d57, + 0x0d60, 0x0d63, + 0x0d66, 0x0d6f, + 0x0d7a, 0x0d7f, + 0x0d82, 0x0d83, + 0x0d85, 0x0d96, + 0x0d9a, 0x0db1, + 0x0db3, 0x0dbb, + 0x0dbd, 0x0dbd, + 0x0dc0, 0x0dc6, + 0x0dca, 0x0dca, + 0x0dcf, 0x0dd4, + 0x0dd6, 0x0dd6, + 0x0dd8, 0x0ddf, + 0x0df2, 0x0df3, + 0x0e01, 0x0e3a, + 0x0e40, 0x0e4e, + 0x0e50, 0x0e59, + 0x0e81, 0x0e82, + 0x0e84, 0x0e84, + 0x0e87, 0x0e88, + 0x0e8a, 0x0e8a, + 0x0e8d, 0x0e8d, + 0x0e94, 0x0e97, + 0x0e99, 0x0e9f, + 0x0ea1, 0x0ea3, + 0x0ea5, 0x0ea5, + 0x0ea7, 0x0ea7, + 0x0eaa, 0x0eab, + 0x0ead, 0x0eb9, + 0x0ebb, 0x0ebd, + 0x0ec0, 0x0ec4, + 0x0ec6, 0x0ec6, + 0x0ec8, 0x0ecd, + 0x0ed0, 0x0ed9, + 0x0edc, 0x0edd, + 0x0f00, 0x0f00, + 0x0f18, 0x0f19, + 0x0f20, 0x0f29, + 0x0f35, 0x0f35, + 0x0f37, 0x0f37, + 0x0f39, 0x0f39, + 0x0f3e, 0x0f47, + 0x0f49, 0x0f6c, + 0x0f71, 0x0f84, + 0x0f86, 0x0f8b, + 0x0f90, 0x0f97, + 0x0f99, 0x0fbc, + 0x0fc6, 0x0fc6, + 0x1000, 0x1049, + 0x1050, 0x109d, + 0x10a0, 0x10c5, + 0x10d0, 0x10fa, + 0x10fc, 0x10fc, + 0x1100, 0x1248, + 0x124a, 0x124d, + 0x1250, 0x1256, + 0x1258, 0x1258, + 0x125a, 0x125d, + 0x1260, 0x1288, + 0x128a, 0x128d, + 0x1290, 0x12b0, + 0x12b2, 0x12b5, + 0x12b8, 0x12be, + 0x12c0, 0x12c0, + 0x12c2, 0x12c5, + 0x12c8, 0x12d6, + 0x12d8, 0x1310, + 0x1312, 0x1315, + 0x1318, 0x135a, + 0x135f, 0x135f, + 0x1369, 0x1371, + 0x1380, 0x138f, + 0x13a0, 0x13f4, + 0x1401, 0x166c, + 0x166f, 0x167f, + 0x1681, 0x169a, + 0x16a0, 0x16ea, + 0x16ee, 0x16f0, + 0x1700, 0x170c, + 0x170e, 0x1714, + 0x1720, 0x1734, + 0x1740, 0x1753, + 0x1760, 0x176c, + 0x176e, 0x1770, + 0x1772, 0x1773, + 0x1780, 0x17b3, + 0x17b6, 0x17d3, + 0x17d7, 0x17d7, + 0x17dc, 0x17dd, + 0x17e0, 0x17e9, + 0x180b, 0x180d, + 0x1810, 0x1819, + 0x1820, 0x1877, + 0x1880, 0x18aa, + 0x18b0, 0x18f5, + 0x1900, 0x191c, + 0x1920, 0x192b, + 0x1930, 0x193b, + 0x1946, 0x196d, + 0x1970, 0x1974, + 0x1980, 0x19ab, + 0x19b0, 0x19c9, + 0x19d0, 0x19da, + 0x1a00, 0x1a1b, + 0x1a20, 0x1a5e, + 0x1a60, 0x1a7c, + 0x1a7f, 0x1a89, + 0x1a90, 0x1a99, + 0x1aa7, 0x1aa7, + 0x1b00, 0x1b4b, + 0x1b50, 0x1b59, + 0x1b6b, 0x1b73, + 0x1b80, 0x1baa, + 0x1bae, 0x1bb9, + 0x1c00, 0x1c37, + 0x1c40, 0x1c49, + 0x1c4d, 0x1c7d, + 0x1cd0, 0x1cd2, + 0x1cd4, 0x1cf2, + 0x1d00, 0x1de6, + 0x1dfd, 0x1f15, + 0x1f18, 0x1f1d, + 0x1f20, 0x1f45, + 0x1f48, 0x1f4d, + 0x1f50, 0x1f57, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f7d, + 0x1f80, 0x1fb4, + 0x1fb6, 0x1fbc, + 0x1fbe, 0x1fbe, + 0x1fc2, 0x1fc4, + 0x1fc6, 0x1fcc, + 0x1fd0, 0x1fd3, + 0x1fd6, 0x1fdb, + 0x1fe0, 0x1fec, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ffc, + 0x203f, 0x2040, + 0x2054, 0x2054, + 0x2071, 0x2071, + 0x207f, 0x207f, + 0x2090, 0x2094, + 0x20d0, 0x20dc, + 0x20e1, 0x20e1, + 0x20e5, 0x20f0, + 0x2102, 0x2102, + 0x2107, 0x2107, + 0x210a, 0x2113, + 0x2115, 0x2115, + 0x2118, 0x211d, + 0x2124, 0x2124, + 0x2126, 0x2126, + 0x2128, 0x2128, + 0x212a, 0x2139, + 0x213c, 0x213f, + 0x2145, 0x2149, + 0x214e, 0x214e, + 0x2160, 0x2188, + 0x2c00, 0x2c2e, + 0x2c30, 0x2c5e, + 0x2c60, 0x2ce4, + 0x2ceb, 0x2cf1, + 0x2d00, 0x2d25, + 0x2d30, 0x2d65, + 0x2d6f, 0x2d6f, + 0x2d80, 0x2d96, + 0x2da0, 0x2da6, + 0x2da8, 0x2dae, + 0x2db0, 0x2db6, + 0x2db8, 0x2dbe, + 0x2dc0, 0x2dc6, + 0x2dc8, 0x2dce, + 0x2dd0, 0x2dd6, + 0x2dd8, 0x2dde, + 0x2de0, 0x2dff, + 0x3005, 0x3007, + 0x3021, 0x302f, + 0x3031, 0x3035, + 0x3038, 0x303c, + 0x3041, 0x3096, + 0x3099, 0x309a, + 0x309d, 0x309f, + 0x30a1, 0x30fa, + 0x30fc, 0x30ff, + 0x3105, 0x312d, + 0x3131, 0x318e, + 0x31a0, 0x31b7, + 0x31f0, 0x31ff, + 0x3400, 0x4db5, + 0x4e00, 0x9fcb, + 0xa000, 0xa48c, + 0xa4d0, 0xa4fd, + 0xa500, 0xa60c, + 0xa610, 0xa62b, + 0xa640, 0xa65f, + 0xa662, 0xa66f, + 0xa67c, 0xa67d, + 0xa67f, 0xa697, + 0xa6a0, 0xa6f1, + 0xa717, 0xa71f, + 0xa722, 0xa788, + 0xa78b, 0xa78c, + 0xa7fb, 0xa827, + 0xa840, 0xa873, + 0xa880, 0xa8c4, + 0xa8d0, 0xa8d9, + 0xa8e0, 0xa8f7, + 0xa8fb, 0xa8fb, + 0xa900, 0xa92d, + 0xa930, 0xa953, + 0xa960, 0xa97c, + 0xa980, 0xa9c0, + 0xa9cf, 0xa9d9, + 0xaa00, 0xaa36, + 0xaa40, 0xaa4d, + 0xaa50, 0xaa59, + 0xaa60, 0xaa76, + 0xaa7a, 0xaa7b, + 0xaa80, 0xaac2, + 0xaadb, 0xaadd, + 0xabc0, 0xabea, + 0xabec, 0xabed, + 0xabf0, 0xabf9, + 0xac00, 0xd7a3, + 0xd7b0, 0xd7c6, + 0xd7cb, 0xd7fb, + 0xf900, 0xfa2d, + 0xfa30, 0xfa6d, + 0xfa70, 0xfad9, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xfb1d, 0xfb28, + 0xfb2a, 0xfb36, + 0xfb38, 0xfb3c, + 0xfb3e, 0xfb3e, + 0xfb40, 0xfb41, + 0xfb43, 0xfb44, + 0xfb46, 0xfbb1, + 0xfbd3, 0xfc5d, + 0xfc64, 0xfd3d, + 0xfd50, 0xfd8f, + 0xfd92, 0xfdc7, + 0xfdf0, 0xfdf9, + 0xfe00, 0xfe0f, + 0xfe20, 0xfe26, + 0xfe33, 0xfe34, + 0xfe4d, 0xfe4f, + 0xfe71, 0xfe71, + 0xfe73, 0xfe73, + 0xfe77, 0xfe77, + 0xfe79, 0xfe79, + 0xfe7b, 0xfe7b, + 0xfe7d, 0xfe7d, + 0xfe7f, 0xfefc, + 0xff10, 0xff19, + 0xff21, 0xff3a, + 0xff3f, 0xff3f, + 0xff41, 0xff5a, + 0xff66, 0xffbe, + 0xffc2, 0xffc7, + 0xffca, 0xffcf, + 0xffd2, 0xffd7, + 0xffda, 0xffdc, + 0x10000, 0x1000b, + 0x1000d, 0x10026, + 0x10028, 0x1003a, + 0x1003c, 0x1003d, + 0x1003f, 0x1004d, + 0x10050, 0x1005d, + 0x10080, 0x100fa, + 0x10140, 0x10174, + 0x101fd, 0x101fd, + 0x10280, 0x1029c, + 0x102a0, 0x102d0, + 0x10300, 0x1031e, + 0x10330, 0x1034a, + 0x10380, 0x1039d, + 0x103a0, 0x103c3, + 0x103c8, 0x103cf, + 0x103d1, 0x103d5, + 0x10400, 0x1049d, + 0x104a0, 0x104a9, + 0x10800, 0x10805, + 0x10808, 0x10808, + 0x1080a, 0x10835, + 0x10837, 0x10838, + 0x1083c, 0x1083c, + 0x1083f, 0x10855, + 0x10900, 0x10915, + 0x10920, 0x10939, + 0x10a00, 0x10a03, + 0x10a05, 0x10a06, + 0x10a0c, 0x10a13, + 0x10a15, 0x10a17, + 0x10a19, 0x10a33, + 0x10a38, 0x10a3a, + 0x10a3f, 0x10a3f, + 0x10a60, 0x10a7c, + 0x10b00, 0x10b35, + 0x10b40, 0x10b55, + 0x10b60, 0x10b72, + 0x10c00, 0x10c48, + 0x11080, 0x110ba, + 0x12000, 0x1236e, + 0x12400, 0x12462, + 0x13000, 0x1342e, + 0x1d165, 0x1d169, + 0x1d16d, 0x1d172, + 0x1d17b, 0x1d182, + 0x1d185, 0x1d18b, + 0x1d1aa, 0x1d1ad, + 0x1d242, 0x1d244, + 0x1d400, 0x1d454, + 0x1d456, 0x1d49c, + 0x1d49e, 0x1d49f, + 0x1d4a2, 0x1d4a2, + 0x1d4a5, 0x1d4a6, + 0x1d4a9, 0x1d4ac, + 0x1d4ae, 0x1d4b9, + 0x1d4bb, 0x1d4bb, + 0x1d4bd, 0x1d4c3, + 0x1d4c5, 0x1d505, + 0x1d507, 0x1d50a, + 0x1d50d, 0x1d514, + 0x1d516, 0x1d51c, + 0x1d51e, 0x1d539, + 0x1d53b, 0x1d53e, + 0x1d540, 0x1d544, + 0x1d546, 0x1d546, + 0x1d54a, 0x1d550, + 0x1d552, 0x1d6a5, + 0x1d6a8, 0x1d6c0, + 0x1d6c2, 0x1d6da, + 0x1d6dc, 0x1d6fa, + 0x1d6fc, 0x1d714, + 0x1d716, 0x1d734, + 0x1d736, 0x1d74e, + 0x1d750, 0x1d76e, + 0x1d770, 0x1d788, + 0x1d78a, 0x1d7a8, + 0x1d7aa, 0x1d7c2, + 0x1d7c4, 0x1d7cb, + 0x1d7ce, 0x1d7ff, + 0x20000, 0x2a6d6, + 0x2a700, 0x2b734, + 0x2f800, 0x2fa1d, + 0xe0100, 0xe01ef, +}; /* CR_XID_Continue */ + +/* 'Default_Ignorable_Code_Point': Derived Property */ +static const OnigCodePoint CR_Default_Ignorable_Code_Point[] = { + 15, + 0x00ad, 0x00ad, + 0x034f, 0x034f, + 0x115f, 0x1160, + 0x17b4, 0x17b5, + 0x180b, 0x180d, + 0x200b, 0x200f, + 0x202a, 0x202e, + 0x2060, 0x206f, + 0x3164, 0x3164, + 0xfe00, 0xfe0f, + 0xfeff, 0xfeff, + 0xffa0, 0xffa0, + 0xfff0, 0xfff8, + 0x1d173, 0x1d17a, + 0xe0000, 0xe0fff, +}; /* CR_Default_Ignorable_Code_Point */ + +/* 'Grapheme_Extend': Derived Property */ +static const OnigCodePoint CR_Grapheme_Extend[] = { + 206, + 0x0300, 0x036f, + 0x0483, 0x0489, + 0x0591, 0x05bd, + 0x05bf, 0x05bf, + 0x05c1, 0x05c2, + 0x05c4, 0x05c5, + 0x05c7, 0x05c7, + 0x0610, 0x061a, + 0x064b, 0x065e, + 0x0670, 0x0670, + 0x06d6, 0x06dc, + 0x06de, 0x06e4, + 0x06e7, 0x06e8, + 0x06ea, 0x06ed, + 0x0711, 0x0711, + 0x0730, 0x074a, + 0x07a6, 0x07b0, + 0x07eb, 0x07f3, + 0x0816, 0x0819, + 0x081b, 0x0823, + 0x0825, 0x0827, + 0x0829, 0x082d, + 0x0900, 0x0902, + 0x093c, 0x093c, + 0x0941, 0x0948, + 0x094d, 0x094d, + 0x0951, 0x0955, + 0x0962, 0x0963, + 0x0981, 0x0981, + 0x09bc, 0x09bc, + 0x09be, 0x09be, + 0x09c1, 0x09c4, + 0x09cd, 0x09cd, + 0x09d7, 0x09d7, + 0x09e2, 0x09e3, + 0x0a01, 0x0a02, + 0x0a3c, 0x0a3c, + 0x0a41, 0x0a42, + 0x0a47, 0x0a48, + 0x0a4b, 0x0a4d, + 0x0a51, 0x0a51, + 0x0a70, 0x0a71, + 0x0a75, 0x0a75, + 0x0a81, 0x0a82, + 0x0abc, 0x0abc, + 0x0ac1, 0x0ac5, + 0x0ac7, 0x0ac8, + 0x0acd, 0x0acd, + 0x0ae2, 0x0ae3, + 0x0b01, 0x0b01, + 0x0b3c, 0x0b3c, + 0x0b3e, 0x0b3f, + 0x0b41, 0x0b44, + 0x0b4d, 0x0b4d, + 0x0b56, 0x0b57, + 0x0b62, 0x0b63, + 0x0b82, 0x0b82, + 0x0bbe, 0x0bbe, + 0x0bc0, 0x0bc0, + 0x0bcd, 0x0bcd, + 0x0bd7, 0x0bd7, + 0x0c3e, 0x0c40, + 0x0c46, 0x0c48, + 0x0c4a, 0x0c4d, + 0x0c55, 0x0c56, + 0x0c62, 0x0c63, + 0x0cbc, 0x0cbc, + 0x0cbf, 0x0cbf, + 0x0cc2, 0x0cc2, + 0x0cc6, 0x0cc6, + 0x0ccc, 0x0ccd, + 0x0cd5, 0x0cd6, + 0x0ce2, 0x0ce3, + 0x0d3e, 0x0d3e, + 0x0d41, 0x0d44, + 0x0d4d, 0x0d4d, + 0x0d57, 0x0d57, + 0x0d62, 0x0d63, + 0x0dca, 0x0dca, + 0x0dcf, 0x0dcf, + 0x0dd2, 0x0dd4, + 0x0dd6, 0x0dd6, + 0x0ddf, 0x0ddf, + 0x0e31, 0x0e31, + 0x0e34, 0x0e3a, + 0x0e47, 0x0e4e, + 0x0eb1, 0x0eb1, + 0x0eb4, 0x0eb9, + 0x0ebb, 0x0ebc, + 0x0ec8, 0x0ecd, + 0x0f18, 0x0f19, + 0x0f35, 0x0f35, + 0x0f37, 0x0f37, + 0x0f39, 0x0f39, + 0x0f71, 0x0f7e, + 0x0f80, 0x0f84, + 0x0f86, 0x0f87, + 0x0f90, 0x0f97, + 0x0f99, 0x0fbc, + 0x0fc6, 0x0fc6, + 0x102d, 0x1030, + 0x1032, 0x1037, + 0x1039, 0x103a, + 0x103d, 0x103e, + 0x1058, 0x1059, + 0x105e, 0x1060, + 0x1071, 0x1074, + 0x1082, 0x1082, + 0x1085, 0x1086, + 0x108d, 0x108d, + 0x109d, 0x109d, + 0x135f, 0x135f, + 0x1712, 0x1714, + 0x1732, 0x1734, + 0x1752, 0x1753, + 0x1772, 0x1773, + 0x17b7, 0x17bd, + 0x17c6, 0x17c6, + 0x17c9, 0x17d3, + 0x17dd, 0x17dd, + 0x180b, 0x180d, + 0x18a9, 0x18a9, + 0x1920, 0x1922, + 0x1927, 0x1928, + 0x1932, 0x1932, + 0x1939, 0x193b, + 0x1a17, 0x1a18, + 0x1a56, 0x1a56, + 0x1a58, 0x1a5e, + 0x1a60, 0x1a60, + 0x1a62, 0x1a62, + 0x1a65, 0x1a6c, + 0x1a73, 0x1a7c, + 0x1a7f, 0x1a7f, + 0x1b00, 0x1b03, + 0x1b34, 0x1b34, + 0x1b36, 0x1b3a, + 0x1b3c, 0x1b3c, + 0x1b42, 0x1b42, + 0x1b6b, 0x1b73, + 0x1b80, 0x1b81, + 0x1ba2, 0x1ba5, + 0x1ba8, 0x1ba9, + 0x1c2c, 0x1c33, + 0x1c36, 0x1c37, + 0x1cd0, 0x1cd2, + 0x1cd4, 0x1ce0, + 0x1ce2, 0x1ce8, + 0x1ced, 0x1ced, + 0x1dc0, 0x1de6, + 0x1dfd, 0x1dff, + 0x200c, 0x200d, + 0x20d0, 0x20f0, + 0x2cef, 0x2cf1, + 0x2de0, 0x2dff, + 0x302a, 0x302f, + 0x3099, 0x309a, + 0xa66f, 0xa672, + 0xa67c, 0xa67d, + 0xa6f0, 0xa6f1, + 0xa802, 0xa802, + 0xa806, 0xa806, + 0xa80b, 0xa80b, + 0xa825, 0xa826, + 0xa8c4, 0xa8c4, + 0xa8e0, 0xa8f1, + 0xa926, 0xa92d, + 0xa947, 0xa951, + 0xa980, 0xa982, + 0xa9b3, 0xa9b3, + 0xa9b6, 0xa9b9, + 0xa9bc, 0xa9bc, + 0xaa29, 0xaa2e, + 0xaa31, 0xaa32, + 0xaa35, 0xaa36, + 0xaa43, 0xaa43, + 0xaa4c, 0xaa4c, + 0xaab0, 0xaab0, + 0xaab2, 0xaab4, + 0xaab7, 0xaab8, + 0xaabe, 0xaabf, + 0xaac1, 0xaac1, + 0xabe5, 0xabe5, + 0xabe8, 0xabe8, + 0xabed, 0xabed, + 0xfb1e, 0xfb1e, + 0xfe00, 0xfe0f, + 0xfe20, 0xfe26, + 0xff9e, 0xff9f, + 0x101fd, 0x101fd, + 0x10a01, 0x10a03, + 0x10a05, 0x10a06, + 0x10a0c, 0x10a0f, + 0x10a38, 0x10a3a, + 0x10a3f, 0x10a3f, + 0x11080, 0x11081, + 0x110b3, 0x110b6, + 0x110b9, 0x110ba, + 0x1d165, 0x1d165, + 0x1d167, 0x1d169, + 0x1d16e, 0x1d172, + 0x1d17b, 0x1d182, + 0x1d185, 0x1d18b, + 0x1d1aa, 0x1d1ad, + 0x1d242, 0x1d244, + 0xe0100, 0xe01ef, +}; /* CR_Grapheme_Extend */ + +/* 'Grapheme_Base': Derived Property */ +static const OnigCodePoint CR_Grapheme_Base[] = { + 567, + 0x0020, 0x007e, + 0x00a0, 0x00ac, + 0x00ae, 0x02ff, + 0x0370, 0x0377, + 0x037a, 0x037e, + 0x0384, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x03a1, + 0x03a3, 0x0482, + 0x048a, 0x0525, + 0x0531, 0x0556, + 0x0559, 0x055f, + 0x0561, 0x0587, + 0x0589, 0x058a, + 0x05be, 0x05be, + 0x05c0, 0x05c0, + 0x05c3, 0x05c3, + 0x05c6, 0x05c6, + 0x05d0, 0x05ea, + 0x05f0, 0x05f4, + 0x0606, 0x060f, + 0x061b, 0x061b, + 0x061e, 0x061f, + 0x0621, 0x064a, + 0x0660, 0x066f, + 0x0671, 0x06d5, + 0x06e5, 0x06e6, + 0x06e9, 0x06e9, + 0x06ee, 0x070d, + 0x0710, 0x0710, + 0x0712, 0x072f, + 0x074d, 0x07a5, + 0x07b1, 0x07b1, + 0x07c0, 0x07ea, + 0x07f4, 0x07fa, + 0x0800, 0x0815, + 0x081a, 0x081a, + 0x0824, 0x0824, + 0x0828, 0x0828, + 0x0830, 0x083e, + 0x0903, 0x0939, + 0x093d, 0x0940, + 0x0949, 0x094c, + 0x094e, 0x094e, + 0x0950, 0x0950, + 0x0958, 0x0961, + 0x0964, 0x0972, + 0x0979, 0x097f, + 0x0982, 0x0983, + 0x0985, 0x098c, + 0x098f, 0x0990, + 0x0993, 0x09a8, + 0x09aa, 0x09b0, + 0x09b2, 0x09b2, + 0x09b6, 0x09b9, + 0x09bd, 0x09bd, + 0x09bf, 0x09c0, + 0x09c7, 0x09c8, + 0x09cb, 0x09cc, + 0x09ce, 0x09ce, + 0x09dc, 0x09dd, + 0x09df, 0x09e1, + 0x09e6, 0x09fb, + 0x0a03, 0x0a03, + 0x0a05, 0x0a0a, + 0x0a0f, 0x0a10, + 0x0a13, 0x0a28, + 0x0a2a, 0x0a30, + 0x0a32, 0x0a33, + 0x0a35, 0x0a36, + 0x0a38, 0x0a39, + 0x0a3e, 0x0a40, + 0x0a59, 0x0a5c, + 0x0a5e, 0x0a5e, + 0x0a66, 0x0a6f, + 0x0a72, 0x0a74, + 0x0a83, 0x0a83, + 0x0a85, 0x0a8d, + 0x0a8f, 0x0a91, + 0x0a93, 0x0aa8, + 0x0aaa, 0x0ab0, + 0x0ab2, 0x0ab3, + 0x0ab5, 0x0ab9, + 0x0abd, 0x0ac0, + 0x0ac9, 0x0ac9, + 0x0acb, 0x0acc, + 0x0ad0, 0x0ad0, + 0x0ae0, 0x0ae1, + 0x0ae6, 0x0aef, + 0x0af1, 0x0af1, + 0x0b02, 0x0b03, + 0x0b05, 0x0b0c, + 0x0b0f, 0x0b10, + 0x0b13, 0x0b28, + 0x0b2a, 0x0b30, + 0x0b32, 0x0b33, + 0x0b35, 0x0b39, + 0x0b3d, 0x0b3d, + 0x0b40, 0x0b40, + 0x0b47, 0x0b48, + 0x0b4b, 0x0b4c, + 0x0b5c, 0x0b5d, + 0x0b5f, 0x0b61, + 0x0b66, 0x0b71, + 0x0b83, 0x0b83, + 0x0b85, 0x0b8a, + 0x0b8e, 0x0b90, + 0x0b92, 0x0b95, + 0x0b99, 0x0b9a, + 0x0b9c, 0x0b9c, + 0x0b9e, 0x0b9f, + 0x0ba3, 0x0ba4, + 0x0ba8, 0x0baa, + 0x0bae, 0x0bb9, + 0x0bbf, 0x0bbf, + 0x0bc1, 0x0bc2, + 0x0bc6, 0x0bc8, + 0x0bca, 0x0bcc, + 0x0bd0, 0x0bd0, + 0x0be6, 0x0bfa, + 0x0c01, 0x0c03, + 0x0c05, 0x0c0c, + 0x0c0e, 0x0c10, + 0x0c12, 0x0c28, + 0x0c2a, 0x0c33, + 0x0c35, 0x0c39, + 0x0c3d, 0x0c3d, + 0x0c41, 0x0c44, + 0x0c58, 0x0c59, + 0x0c60, 0x0c61, + 0x0c66, 0x0c6f, + 0x0c78, 0x0c7f, + 0x0c82, 0x0c83, + 0x0c85, 0x0c8c, + 0x0c8e, 0x0c90, + 0x0c92, 0x0ca8, + 0x0caa, 0x0cb3, + 0x0cb5, 0x0cb9, + 0x0cbd, 0x0cbe, + 0x0cc0, 0x0cc1, + 0x0cc3, 0x0cc4, + 0x0cc7, 0x0cc8, + 0x0cca, 0x0ccb, + 0x0cde, 0x0cde, + 0x0ce0, 0x0ce1, + 0x0ce6, 0x0cef, + 0x0cf1, 0x0cf2, + 0x0d02, 0x0d03, + 0x0d05, 0x0d0c, + 0x0d0e, 0x0d10, + 0x0d12, 0x0d28, + 0x0d2a, 0x0d39, + 0x0d3d, 0x0d3d, + 0x0d3f, 0x0d40, + 0x0d46, 0x0d48, + 0x0d4a, 0x0d4c, + 0x0d60, 0x0d61, + 0x0d66, 0x0d75, + 0x0d79, 0x0d7f, + 0x0d82, 0x0d83, + 0x0d85, 0x0d96, + 0x0d9a, 0x0db1, + 0x0db3, 0x0dbb, + 0x0dbd, 0x0dbd, + 0x0dc0, 0x0dc6, + 0x0dd0, 0x0dd1, + 0x0dd8, 0x0dde, + 0x0df2, 0x0df4, + 0x0e01, 0x0e30, + 0x0e32, 0x0e33, + 0x0e3f, 0x0e46, + 0x0e4f, 0x0e5b, + 0x0e81, 0x0e82, + 0x0e84, 0x0e84, + 0x0e87, 0x0e88, + 0x0e8a, 0x0e8a, + 0x0e8d, 0x0e8d, + 0x0e94, 0x0e97, + 0x0e99, 0x0e9f, + 0x0ea1, 0x0ea3, + 0x0ea5, 0x0ea5, + 0x0ea7, 0x0ea7, + 0x0eaa, 0x0eab, + 0x0ead, 0x0eb0, + 0x0eb2, 0x0eb3, + 0x0ebd, 0x0ebd, + 0x0ec0, 0x0ec4, + 0x0ec6, 0x0ec6, + 0x0ed0, 0x0ed9, + 0x0edc, 0x0edd, + 0x0f00, 0x0f17, + 0x0f1a, 0x0f34, + 0x0f36, 0x0f36, + 0x0f38, 0x0f38, + 0x0f3a, 0x0f47, + 0x0f49, 0x0f6c, + 0x0f7f, 0x0f7f, + 0x0f85, 0x0f85, + 0x0f88, 0x0f8b, + 0x0fbe, 0x0fc5, + 0x0fc7, 0x0fcc, + 0x0fce, 0x0fd8, + 0x1000, 0x102c, + 0x1031, 0x1031, + 0x1038, 0x1038, + 0x103b, 0x103c, + 0x103f, 0x1057, + 0x105a, 0x105d, + 0x1061, 0x1070, + 0x1075, 0x1081, + 0x1083, 0x1084, + 0x1087, 0x108c, + 0x108e, 0x109c, + 0x109e, 0x10c5, + 0x10d0, 0x10fc, + 0x1100, 0x1248, + 0x124a, 0x124d, + 0x1250, 0x1256, + 0x1258, 0x1258, + 0x125a, 0x125d, + 0x1260, 0x1288, + 0x128a, 0x128d, + 0x1290, 0x12b0, + 0x12b2, 0x12b5, + 0x12b8, 0x12be, + 0x12c0, 0x12c0, + 0x12c2, 0x12c5, + 0x12c8, 0x12d6, + 0x12d8, 0x1310, + 0x1312, 0x1315, + 0x1318, 0x135a, + 0x1360, 0x137c, + 0x1380, 0x1399, + 0x13a0, 0x13f4, + 0x1400, 0x169c, + 0x16a0, 0x16f0, + 0x1700, 0x170c, + 0x170e, 0x1711, + 0x1720, 0x1731, + 0x1735, 0x1736, + 0x1740, 0x1751, + 0x1760, 0x176c, + 0x176e, 0x1770, + 0x1780, 0x17b3, + 0x17b6, 0x17b6, + 0x17be, 0x17c5, + 0x17c7, 0x17c8, + 0x17d4, 0x17dc, + 0x17e0, 0x17e9, + 0x17f0, 0x17f9, + 0x1800, 0x180a, + 0x180e, 0x180e, + 0x1810, 0x1819, + 0x1820, 0x1877, + 0x1880, 0x18a8, + 0x18aa, 0x18aa, + 0x18b0, 0x18f5, + 0x1900, 0x191c, + 0x1923, 0x1926, + 0x1929, 0x192b, + 0x1930, 0x1931, + 0x1933, 0x1938, + 0x1940, 0x1940, + 0x1944, 0x196d, + 0x1970, 0x1974, + 0x1980, 0x19ab, + 0x19b0, 0x19c9, + 0x19d0, 0x19da, + 0x19de, 0x1a16, + 0x1a19, 0x1a1b, + 0x1a1e, 0x1a55, + 0x1a57, 0x1a57, + 0x1a61, 0x1a61, + 0x1a63, 0x1a64, + 0x1a6d, 0x1a72, + 0x1a80, 0x1a89, + 0x1a90, 0x1a99, + 0x1aa0, 0x1aad, + 0x1b04, 0x1b33, + 0x1b35, 0x1b35, + 0x1b3b, 0x1b3b, + 0x1b3d, 0x1b41, + 0x1b43, 0x1b4b, + 0x1b50, 0x1b6a, + 0x1b74, 0x1b7c, + 0x1b82, 0x1ba1, + 0x1ba6, 0x1ba7, + 0x1baa, 0x1baa, + 0x1bae, 0x1bb9, + 0x1c00, 0x1c2b, + 0x1c34, 0x1c35, + 0x1c3b, 0x1c49, + 0x1c4d, 0x1c7f, + 0x1cd3, 0x1cd3, + 0x1ce1, 0x1ce1, + 0x1ce9, 0x1cec, + 0x1cee, 0x1cf2, + 0x1d00, 0x1dbf, + 0x1e00, 0x1f15, + 0x1f18, 0x1f1d, + 0x1f20, 0x1f45, + 0x1f48, 0x1f4d, + 0x1f50, 0x1f57, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f7d, + 0x1f80, 0x1fb4, + 0x1fb6, 0x1fc4, + 0x1fc6, 0x1fd3, + 0x1fd6, 0x1fdb, + 0x1fdd, 0x1fef, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ffe, + 0x2000, 0x200a, + 0x2010, 0x2027, + 0x202f, 0x205f, + 0x2070, 0x2071, + 0x2074, 0x208e, + 0x2090, 0x2094, + 0x20a0, 0x20b8, + 0x2100, 0x2189, + 0x2190, 0x23e8, + 0x2400, 0x2426, + 0x2440, 0x244a, + 0x2460, 0x26cd, + 0x26cf, 0x26e1, + 0x26e3, 0x26e3, + 0x26e8, 0x26ff, + 0x2701, 0x2704, + 0x2706, 0x2709, + 0x270c, 0x2727, + 0x2729, 0x274b, + 0x274d, 0x274d, + 0x274f, 0x2752, + 0x2756, 0x275e, + 0x2761, 0x2794, + 0x2798, 0x27af, + 0x27b1, 0x27be, + 0x27c0, 0x27ca, + 0x27cc, 0x27cc, + 0x27d0, 0x2b4c, + 0x2b50, 0x2b59, + 0x2c00, 0x2c2e, + 0x2c30, 0x2c5e, + 0x2c60, 0x2cee, + 0x2cf9, 0x2d25, + 0x2d30, 0x2d65, + 0x2d6f, 0x2d6f, + 0x2d80, 0x2d96, + 0x2da0, 0x2da6, + 0x2da8, 0x2dae, + 0x2db0, 0x2db6, + 0x2db8, 0x2dbe, + 0x2dc0, 0x2dc6, + 0x2dc8, 0x2dce, + 0x2dd0, 0x2dd6, + 0x2dd8, 0x2dde, + 0x2e00, 0x2e31, + 0x2e80, 0x2e99, + 0x2e9b, 0x2ef3, + 0x2f00, 0x2fd5, + 0x2ff0, 0x2ffb, + 0x3000, 0x3029, + 0x3030, 0x303f, + 0x3041, 0x3096, + 0x309b, 0x30ff, + 0x3105, 0x312d, + 0x3131, 0x318e, + 0x3190, 0x31b7, + 0x31c0, 0x31e3, + 0x31f0, 0x321e, + 0x3220, 0x32fe, + 0x3300, 0x4db5, + 0x4dc0, 0x9fcb, + 0xa000, 0xa48c, + 0xa490, 0xa4c6, + 0xa4d0, 0xa62b, + 0xa640, 0xa65f, + 0xa662, 0xa66e, + 0xa673, 0xa673, + 0xa67e, 0xa697, + 0xa6a0, 0xa6ef, + 0xa6f2, 0xa6f7, + 0xa700, 0xa78c, + 0xa7fb, 0xa801, + 0xa803, 0xa805, + 0xa807, 0xa80a, + 0xa80c, 0xa824, + 0xa827, 0xa82b, + 0xa830, 0xa839, + 0xa840, 0xa877, + 0xa880, 0xa8c3, + 0xa8ce, 0xa8d9, + 0xa8f2, 0xa8fb, + 0xa900, 0xa925, + 0xa92e, 0xa946, + 0xa952, 0xa953, + 0xa95f, 0xa97c, + 0xa983, 0xa9b2, + 0xa9b4, 0xa9b5, + 0xa9ba, 0xa9bb, + 0xa9bd, 0xa9cd, + 0xa9cf, 0xa9d9, + 0xa9de, 0xa9df, + 0xaa00, 0xaa28, + 0xaa2f, 0xaa30, + 0xaa33, 0xaa34, + 0xaa40, 0xaa42, + 0xaa44, 0xaa4b, + 0xaa4d, 0xaa4d, + 0xaa50, 0xaa59, + 0xaa5c, 0xaa7b, + 0xaa80, 0xaaaf, + 0xaab1, 0xaab1, + 0xaab5, 0xaab6, + 0xaab9, 0xaabd, + 0xaac0, 0xaac0, + 0xaac2, 0xaac2, + 0xaadb, 0xaadf, + 0xabc0, 0xabe4, + 0xabe6, 0xabe7, + 0xabe9, 0xabec, + 0xabf0, 0xabf9, + 0xac00, 0xd7a3, + 0xd7b0, 0xd7c6, + 0xd7cb, 0xd7fb, + 0xf900, 0xfa2d, + 0xfa30, 0xfa6d, + 0xfa70, 0xfad9, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xfb1d, 0xfb1d, + 0xfb1f, 0xfb36, + 0xfb38, 0xfb3c, + 0xfb3e, 0xfb3e, + 0xfb40, 0xfb41, + 0xfb43, 0xfb44, + 0xfb46, 0xfbb1, + 0xfbd3, 0xfd3f, + 0xfd50, 0xfd8f, + 0xfd92, 0xfdc7, + 0xfdf0, 0xfdfd, + 0xfe10, 0xfe19, + 0xfe30, 0xfe52, + 0xfe54, 0xfe66, + 0xfe68, 0xfe6b, + 0xfe70, 0xfe74, + 0xfe76, 0xfefc, + 0xff01, 0xff9d, + 0xffa0, 0xffbe, + 0xffc2, 0xffc7, + 0xffca, 0xffcf, + 0xffd2, 0xffd7, + 0xffda, 0xffdc, + 0xffe0, 0xffe6, + 0xffe8, 0xffee, + 0xfffc, 0xfffd, + 0x10000, 0x1000b, + 0x1000d, 0x10026, + 0x10028, 0x1003a, + 0x1003c, 0x1003d, + 0x1003f, 0x1004d, + 0x10050, 0x1005d, + 0x10080, 0x100fa, + 0x10100, 0x10102, + 0x10107, 0x10133, + 0x10137, 0x1018a, + 0x10190, 0x1019b, + 0x101d0, 0x101fc, + 0x10280, 0x1029c, + 0x102a0, 0x102d0, + 0x10300, 0x1031e, + 0x10320, 0x10323, + 0x10330, 0x1034a, + 0x10380, 0x1039d, + 0x1039f, 0x103c3, + 0x103c8, 0x103d5, + 0x10400, 0x1049d, + 0x104a0, 0x104a9, + 0x10800, 0x10805, + 0x10808, 0x10808, + 0x1080a, 0x10835, + 0x10837, 0x10838, + 0x1083c, 0x1083c, + 0x1083f, 0x10855, + 0x10857, 0x1085f, + 0x10900, 0x1091b, + 0x1091f, 0x10939, + 0x1093f, 0x1093f, + 0x10a00, 0x10a00, + 0x10a10, 0x10a13, + 0x10a15, 0x10a17, + 0x10a19, 0x10a33, + 0x10a40, 0x10a47, + 0x10a50, 0x10a58, + 0x10a60, 0x10a7f, + 0x10b00, 0x10b35, + 0x10b39, 0x10b55, + 0x10b58, 0x10b72, + 0x10b78, 0x10b7f, + 0x10c00, 0x10c48, + 0x10e60, 0x10e7e, + 0x11082, 0x110b2, + 0x110b7, 0x110b8, + 0x110bb, 0x110bc, + 0x110be, 0x110c1, + 0x12000, 0x1236e, + 0x12400, 0x12462, + 0x12470, 0x12473, + 0x13000, 0x1342e, + 0x1d000, 0x1d0f5, + 0x1d100, 0x1d126, + 0x1d129, 0x1d164, + 0x1d166, 0x1d166, + 0x1d16a, 0x1d16d, + 0x1d183, 0x1d184, + 0x1d18c, 0x1d1a9, + 0x1d1ae, 0x1d1dd, + 0x1d200, 0x1d241, + 0x1d245, 0x1d245, + 0x1d300, 0x1d356, + 0x1d360, 0x1d371, + 0x1d400, 0x1d454, + 0x1d456, 0x1d49c, + 0x1d49e, 0x1d49f, + 0x1d4a2, 0x1d4a2, + 0x1d4a5, 0x1d4a6, + 0x1d4a9, 0x1d4ac, + 0x1d4ae, 0x1d4b9, + 0x1d4bb, 0x1d4bb, + 0x1d4bd, 0x1d4c3, + 0x1d4c5, 0x1d505, + 0x1d507, 0x1d50a, + 0x1d50d, 0x1d514, + 0x1d516, 0x1d51c, + 0x1d51e, 0x1d539, + 0x1d53b, 0x1d53e, + 0x1d540, 0x1d544, + 0x1d546, 0x1d546, + 0x1d54a, 0x1d550, + 0x1d552, 0x1d6a5, + 0x1d6a8, 0x1d7cb, + 0x1d7ce, 0x1d7ff, + 0x1f000, 0x1f02b, + 0x1f030, 0x1f093, + 0x1f100, 0x1f10a, + 0x1f110, 0x1f12e, + 0x1f131, 0x1f131, + 0x1f13d, 0x1f13d, + 0x1f13f, 0x1f13f, + 0x1f142, 0x1f142, + 0x1f146, 0x1f146, + 0x1f14a, 0x1f14e, + 0x1f157, 0x1f157, + 0x1f15f, 0x1f15f, + 0x1f179, 0x1f179, + 0x1f17b, 0x1f17c, + 0x1f17f, 0x1f17f, + 0x1f18a, 0x1f18d, + 0x1f190, 0x1f190, + 0x1f200, 0x1f200, + 0x1f210, 0x1f231, + 0x1f240, 0x1f248, + 0x20000, 0x2a6d6, + 0x2a700, 0x2b734, + 0x2f800, 0x2fa1d, +}; /* CR_Grapheme_Base */ + +/* 'Grapheme_Link': Derived Property */ +static const OnigCodePoint CR_Grapheme_Link[] = { + 26, + 0x094d, 0x094d, + 0x09cd, 0x09cd, + 0x0a4d, 0x0a4d, + 0x0acd, 0x0acd, + 0x0b4d, 0x0b4d, + 0x0bcd, 0x0bcd, + 0x0c4d, 0x0c4d, + 0x0ccd, 0x0ccd, + 0x0d4d, 0x0d4d, + 0x0dca, 0x0dca, + 0x0e3a, 0x0e3a, + 0x0f84, 0x0f84, + 0x1039, 0x103a, + 0x1714, 0x1714, + 0x1734, 0x1734, + 0x17d2, 0x17d2, + 0x1a60, 0x1a60, + 0x1b44, 0x1b44, + 0x1baa, 0x1baa, + 0xa806, 0xa806, + 0xa8c4, 0xa8c4, + 0xa953, 0xa953, + 0xa9c0, 0xa9c0, + 0xabed, 0xabed, + 0x10a3f, 0x10a3f, + 0x110b9, 0x110b9, +}; /* CR_Grapheme_Link */ + +/* 'Common': Script */ +static const OnigCodePoint CR_Common[] = { + 159, + 0x0000, 0x0040, + 0x005b, 0x0060, + 0x007b, 0x00a9, + 0x00ab, 0x00b9, + 0x00bb, 0x00bf, + 0x00d7, 0x00d7, + 0x00f7, 0x00f7, + 0x02b9, 0x02df, + 0x02e5, 0x02ff, + 0x0374, 0x0374, + 0x037e, 0x037e, + 0x0385, 0x0385, + 0x0387, 0x0387, + 0x0589, 0x0589, + 0x0600, 0x0603, + 0x060c, 0x060c, + 0x061b, 0x061b, + 0x061f, 0x061f, + 0x0640, 0x0640, + 0x0660, 0x0669, + 0x06dd, 0x06dd, + 0x0964, 0x0965, + 0x0970, 0x0970, + 0x0cf1, 0x0cf2, + 0x0e3f, 0x0e3f, + 0x0fd5, 0x0fd8, + 0x10fb, 0x10fb, + 0x16eb, 0x16ed, + 0x1735, 0x1736, + 0x1802, 0x1803, + 0x1805, 0x1805, + 0x1cd3, 0x1cd3, + 0x1ce1, 0x1ce1, + 0x1ce9, 0x1cec, + 0x1cee, 0x1cf2, + 0x2000, 0x200b, + 0x200e, 0x2064, + 0x206a, 0x2070, + 0x2074, 0x207e, + 0x2080, 0x208e, + 0x20a0, 0x20b8, + 0x2100, 0x2125, + 0x2127, 0x2129, + 0x212c, 0x2131, + 0x2133, 0x214d, + 0x214f, 0x215f, + 0x2189, 0x2189, + 0x2190, 0x23e8, + 0x2400, 0x2426, + 0x2440, 0x244a, + 0x2460, 0x26cd, + 0x26cf, 0x26e1, + 0x26e3, 0x26e3, + 0x26e8, 0x26ff, + 0x2701, 0x2704, + 0x2706, 0x2709, + 0x270c, 0x2727, + 0x2729, 0x274b, + 0x274d, 0x274d, + 0x274f, 0x2752, + 0x2756, 0x275e, + 0x2761, 0x2794, + 0x2798, 0x27af, + 0x27b1, 0x27be, + 0x27c0, 0x27ca, + 0x27cc, 0x27cc, + 0x27d0, 0x27ff, + 0x2900, 0x2b4c, + 0x2b50, 0x2b59, + 0x2e00, 0x2e31, + 0x2ff0, 0x2ffb, + 0x3000, 0x3004, + 0x3006, 0x3006, + 0x3008, 0x3020, + 0x3030, 0x3037, + 0x303c, 0x303f, + 0x309b, 0x309c, + 0x30a0, 0x30a0, + 0x30fb, 0x30fc, + 0x3190, 0x319f, + 0x31c0, 0x31e3, + 0x3220, 0x325f, + 0x327f, 0x32cf, + 0x3358, 0x33ff, + 0x4dc0, 0x4dff, + 0xa700, 0xa721, + 0xa788, 0xa78a, + 0xa830, 0xa839, + 0xfd3e, 0xfd3f, + 0xfdfd, 0xfdfd, + 0xfe10, 0xfe19, + 0xfe30, 0xfe52, + 0xfe54, 0xfe66, + 0xfe68, 0xfe6b, + 0xfeff, 0xfeff, + 0xff01, 0xff20, + 0xff3b, 0xff40, + 0xff5b, 0xff65, + 0xff70, 0xff70, + 0xff9e, 0xff9f, + 0xffe0, 0xffe6, + 0xffe8, 0xffee, + 0xfff9, 0xfffd, + 0x10100, 0x10102, + 0x10107, 0x10133, + 0x10137, 0x1013f, + 0x10190, 0x1019b, + 0x101d0, 0x101fc, + 0x1d000, 0x1d0f5, + 0x1d100, 0x1d126, + 0x1d129, 0x1d166, + 0x1d16a, 0x1d17a, + 0x1d183, 0x1d184, + 0x1d18c, 0x1d1a9, + 0x1d1ae, 0x1d1dd, + 0x1d300, 0x1d356, + 0x1d360, 0x1d371, + 0x1d400, 0x1d454, + 0x1d456, 0x1d49c, + 0x1d49e, 0x1d49f, + 0x1d4a2, 0x1d4a2, + 0x1d4a5, 0x1d4a6, + 0x1d4a9, 0x1d4ac, + 0x1d4ae, 0x1d4b9, + 0x1d4bb, 0x1d4bb, + 0x1d4bd, 0x1d4c3, + 0x1d4c5, 0x1d505, + 0x1d507, 0x1d50a, + 0x1d50d, 0x1d514, + 0x1d516, 0x1d51c, + 0x1d51e, 0x1d539, + 0x1d53b, 0x1d53e, + 0x1d540, 0x1d544, + 0x1d546, 0x1d546, + 0x1d54a, 0x1d550, + 0x1d552, 0x1d6a5, + 0x1d6a8, 0x1d7cb, + 0x1d7ce, 0x1d7ff, + 0x1f000, 0x1f02b, + 0x1f030, 0x1f093, + 0x1f100, 0x1f10a, + 0x1f110, 0x1f12e, + 0x1f131, 0x1f131, + 0x1f13d, 0x1f13d, + 0x1f13f, 0x1f13f, + 0x1f142, 0x1f142, + 0x1f146, 0x1f146, + 0x1f14a, 0x1f14e, + 0x1f157, 0x1f157, + 0x1f15f, 0x1f15f, + 0x1f179, 0x1f179, + 0x1f17b, 0x1f17c, + 0x1f17f, 0x1f17f, + 0x1f18a, 0x1f18d, + 0x1f190, 0x1f190, + 0x1f210, 0x1f231, + 0x1f240, 0x1f248, + 0xe0001, 0xe0001, + 0xe0020, 0xe007f, +}; /* CR_Common */ + +/* 'Latin': Script */ +static const OnigCodePoint CR_Latin[] = { + 28, + 0x0041, 0x005a, + 0x0061, 0x007a, + 0x00aa, 0x00aa, + 0x00ba, 0x00ba, + 0x00c0, 0x00d6, + 0x00d8, 0x00f6, + 0x00f8, 0x02b8, + 0x02e0, 0x02e4, + 0x1d00, 0x1d25, + 0x1d2c, 0x1d5c, + 0x1d62, 0x1d65, + 0x1d6b, 0x1d77, + 0x1d79, 0x1dbe, + 0x1e00, 0x1eff, + 0x2071, 0x2071, + 0x207f, 0x207f, + 0x2090, 0x2094, + 0x212a, 0x212b, + 0x2132, 0x2132, + 0x214e, 0x214e, + 0x2160, 0x2188, + 0x2c60, 0x2c7f, + 0xa722, 0xa787, + 0xa78b, 0xa78c, + 0xa7fb, 0xa7ff, + 0xfb00, 0xfb06, + 0xff21, 0xff3a, + 0xff41, 0xff5a, +}; /* CR_Latin */ + +/* 'Greek': Script */ +static const OnigCodePoint CR_Greek[] = { + 33, + 0x0370, 0x0373, + 0x0375, 0x0377, + 0x037a, 0x037d, + 0x0384, 0x0384, + 0x0386, 0x0386, + 0x0388, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x03a1, + 0x03a3, 0x03e1, + 0x03f0, 0x03ff, + 0x1d26, 0x1d2a, + 0x1d5d, 0x1d61, + 0x1d66, 0x1d6a, + 0x1dbf, 0x1dbf, + 0x1f00, 0x1f15, + 0x1f18, 0x1f1d, + 0x1f20, 0x1f45, + 0x1f48, 0x1f4d, + 0x1f50, 0x1f57, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f7d, + 0x1f80, 0x1fb4, + 0x1fb6, 0x1fc4, + 0x1fc6, 0x1fd3, + 0x1fd6, 0x1fdb, + 0x1fdd, 0x1fef, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ffe, + 0x2126, 0x2126, + 0x10140, 0x1018a, + 0x1d200, 0x1d245, +}; /* CR_Greek */ + +/* 'Cyrillic': Script */ +static const OnigCodePoint CR_Cyrillic[] = { + 8, + 0x0400, 0x0484, + 0x0487, 0x0525, + 0x1d2b, 0x1d2b, + 0x1d78, 0x1d78, + 0x2de0, 0x2dff, + 0xa640, 0xa65f, + 0xa662, 0xa673, + 0xa67c, 0xa697, +}; /* CR_Cyrillic */ + +/* 'Armenian': Script */ +static const OnigCodePoint CR_Armenian[] = { + 5, + 0x0531, 0x0556, + 0x0559, 0x055f, + 0x0561, 0x0587, + 0x058a, 0x058a, + 0xfb13, 0xfb17, +}; /* CR_Armenian */ + +/* 'Hebrew': Script */ +static const OnigCodePoint CR_Hebrew[] = { + 9, + 0x0591, 0x05c7, + 0x05d0, 0x05ea, + 0x05f0, 0x05f4, + 0xfb1d, 0xfb36, + 0xfb38, 0xfb3c, + 0xfb3e, 0xfb3e, + 0xfb40, 0xfb41, + 0xfb43, 0xfb44, + 0xfb46, 0xfb4f, +}; /* CR_Hebrew */ + +/* 'Arabic': Script */ +static const OnigCodePoint CR_Arabic[] = { + 18, + 0x0606, 0x060b, + 0x060d, 0x061a, + 0x061e, 0x061e, + 0x0621, 0x063f, + 0x0641, 0x064a, + 0x0656, 0x065e, + 0x066a, 0x066f, + 0x0671, 0x06dc, + 0x06de, 0x06ff, + 0x0750, 0x077f, + 0xfb50, 0xfbb1, + 0xfbd3, 0xfd3d, + 0xfd50, 0xfd8f, + 0xfd92, 0xfdc7, + 0xfdf0, 0xfdfc, + 0xfe70, 0xfe74, + 0xfe76, 0xfefc, + 0x10e60, 0x10e7e, +}; /* CR_Arabic */ + +/* 'Syriac': Script */ +static const OnigCodePoint CR_Syriac[] = { + 3, + 0x0700, 0x070d, + 0x070f, 0x074a, + 0x074d, 0x074f, +}; /* CR_Syriac */ + +/* 'Thaana': Script */ +static const OnigCodePoint CR_Thaana[] = { + 1, + 0x0780, 0x07b1, +}; /* CR_Thaana */ + +/* 'Devanagari': Script */ +static const OnigCodePoint CR_Devanagari[] = { + 9, + 0x0900, 0x0939, + 0x093c, 0x094e, + 0x0950, 0x0950, + 0x0953, 0x0955, + 0x0958, 0x0963, + 0x0966, 0x096f, + 0x0971, 0x0972, + 0x0979, 0x097f, + 0xa8e0, 0xa8fb, +}; /* CR_Devanagari */ + +/* 'Bengali': Script */ +static const OnigCodePoint CR_Bengali[] = { + 14, + 0x0981, 0x0983, + 0x0985, 0x098c, + 0x098f, 0x0990, + 0x0993, 0x09a8, + 0x09aa, 0x09b0, + 0x09b2, 0x09b2, + 0x09b6, 0x09b9, + 0x09bc, 0x09c4, + 0x09c7, 0x09c8, + 0x09cb, 0x09ce, + 0x09d7, 0x09d7, + 0x09dc, 0x09dd, + 0x09df, 0x09e3, + 0x09e6, 0x09fb, +}; /* CR_Bengali */ + +/* 'Gurmukhi': Script */ +static const OnigCodePoint CR_Gurmukhi[] = { + 16, + 0x0a01, 0x0a03, + 0x0a05, 0x0a0a, + 0x0a0f, 0x0a10, + 0x0a13, 0x0a28, + 0x0a2a, 0x0a30, + 0x0a32, 0x0a33, + 0x0a35, 0x0a36, + 0x0a38, 0x0a39, + 0x0a3c, 0x0a3c, + 0x0a3e, 0x0a42, + 0x0a47, 0x0a48, + 0x0a4b, 0x0a4d, + 0x0a51, 0x0a51, + 0x0a59, 0x0a5c, + 0x0a5e, 0x0a5e, + 0x0a66, 0x0a75, +}; /* CR_Gurmukhi */ + +/* 'Gujarati': Script */ +static const OnigCodePoint CR_Gujarati[] = { + 14, + 0x0a81, 0x0a83, + 0x0a85, 0x0a8d, + 0x0a8f, 0x0a91, + 0x0a93, 0x0aa8, + 0x0aaa, 0x0ab0, + 0x0ab2, 0x0ab3, + 0x0ab5, 0x0ab9, + 0x0abc, 0x0ac5, + 0x0ac7, 0x0ac9, + 0x0acb, 0x0acd, + 0x0ad0, 0x0ad0, + 0x0ae0, 0x0ae3, + 0x0ae6, 0x0aef, + 0x0af1, 0x0af1, +}; /* CR_Gujarati */ + +/* 'Oriya': Script */ +static const OnigCodePoint CR_Oriya[] = { + 14, + 0x0b01, 0x0b03, + 0x0b05, 0x0b0c, + 0x0b0f, 0x0b10, + 0x0b13, 0x0b28, + 0x0b2a, 0x0b30, + 0x0b32, 0x0b33, + 0x0b35, 0x0b39, + 0x0b3c, 0x0b44, + 0x0b47, 0x0b48, + 0x0b4b, 0x0b4d, + 0x0b56, 0x0b57, + 0x0b5c, 0x0b5d, + 0x0b5f, 0x0b63, + 0x0b66, 0x0b71, +}; /* CR_Oriya */ + +/* 'Tamil': Script */ +static const OnigCodePoint CR_Tamil[] = { + 16, + 0x0b82, 0x0b83, + 0x0b85, 0x0b8a, + 0x0b8e, 0x0b90, + 0x0b92, 0x0b95, + 0x0b99, 0x0b9a, + 0x0b9c, 0x0b9c, + 0x0b9e, 0x0b9f, + 0x0ba3, 0x0ba4, + 0x0ba8, 0x0baa, + 0x0bae, 0x0bb9, + 0x0bbe, 0x0bc2, + 0x0bc6, 0x0bc8, + 0x0bca, 0x0bcd, + 0x0bd0, 0x0bd0, + 0x0bd7, 0x0bd7, + 0x0be6, 0x0bfa, +}; /* CR_Tamil */ + +/* 'Telugu': Script */ +static const OnigCodePoint CR_Telugu[] = { + 14, + 0x0c01, 0x0c03, + 0x0c05, 0x0c0c, + 0x0c0e, 0x0c10, + 0x0c12, 0x0c28, + 0x0c2a, 0x0c33, + 0x0c35, 0x0c39, + 0x0c3d, 0x0c44, + 0x0c46, 0x0c48, + 0x0c4a, 0x0c4d, + 0x0c55, 0x0c56, + 0x0c58, 0x0c59, + 0x0c60, 0x0c63, + 0x0c66, 0x0c6f, + 0x0c78, 0x0c7f, +}; /* CR_Telugu */ + +/* 'Kannada': Script */ +static const OnigCodePoint CR_Kannada[] = { + 13, + 0x0c82, 0x0c83, + 0x0c85, 0x0c8c, + 0x0c8e, 0x0c90, + 0x0c92, 0x0ca8, + 0x0caa, 0x0cb3, + 0x0cb5, 0x0cb9, + 0x0cbc, 0x0cc4, + 0x0cc6, 0x0cc8, + 0x0cca, 0x0ccd, + 0x0cd5, 0x0cd6, + 0x0cde, 0x0cde, + 0x0ce0, 0x0ce3, + 0x0ce6, 0x0cef, +}; /* CR_Kannada */ + +/* 'Malayalam': Script */ +static const OnigCodePoint CR_Malayalam[] = { + 12, + 0x0d02, 0x0d03, + 0x0d05, 0x0d0c, + 0x0d0e, 0x0d10, + 0x0d12, 0x0d28, + 0x0d2a, 0x0d39, + 0x0d3d, 0x0d44, + 0x0d46, 0x0d48, + 0x0d4a, 0x0d4d, + 0x0d57, 0x0d57, + 0x0d60, 0x0d63, + 0x0d66, 0x0d75, + 0x0d79, 0x0d7f, +}; /* CR_Malayalam */ + +/* 'Sinhala': Script */ +static const OnigCodePoint CR_Sinhala[] = { + 11, + 0x0d82, 0x0d83, + 0x0d85, 0x0d96, + 0x0d9a, 0x0db1, + 0x0db3, 0x0dbb, + 0x0dbd, 0x0dbd, + 0x0dc0, 0x0dc6, + 0x0dca, 0x0dca, + 0x0dcf, 0x0dd4, + 0x0dd6, 0x0dd6, + 0x0dd8, 0x0ddf, + 0x0df2, 0x0df4, +}; /* CR_Sinhala */ + +/* 'Thai': Script */ +static const OnigCodePoint CR_Thai[] = { + 2, + 0x0e01, 0x0e3a, + 0x0e40, 0x0e5b, +}; /* CR_Thai */ + +/* 'Lao': Script */ +static const OnigCodePoint CR_Lao[] = { + 18, + 0x0e81, 0x0e82, + 0x0e84, 0x0e84, + 0x0e87, 0x0e88, + 0x0e8a, 0x0e8a, + 0x0e8d, 0x0e8d, + 0x0e94, 0x0e97, + 0x0e99, 0x0e9f, + 0x0ea1, 0x0ea3, + 0x0ea5, 0x0ea5, + 0x0ea7, 0x0ea7, + 0x0eaa, 0x0eab, + 0x0ead, 0x0eb9, + 0x0ebb, 0x0ebd, + 0x0ec0, 0x0ec4, + 0x0ec6, 0x0ec6, + 0x0ec8, 0x0ecd, + 0x0ed0, 0x0ed9, + 0x0edc, 0x0edd, +}; /* CR_Lao */ + +/* 'Tibetan': Script */ +static const OnigCodePoint CR_Tibetan[] = { + 7, + 0x0f00, 0x0f47, + 0x0f49, 0x0f6c, + 0x0f71, 0x0f8b, + 0x0f90, 0x0f97, + 0x0f99, 0x0fbc, + 0x0fbe, 0x0fcc, + 0x0fce, 0x0fd4, +}; /* CR_Tibetan */ + +/* 'Myanmar': Script */ +static const OnigCodePoint CR_Myanmar[] = { + 2, + 0x1000, 0x109f, + 0xaa60, 0xaa7b, +}; /* CR_Myanmar */ + +/* 'Georgian': Script */ +static const OnigCodePoint CR_Georgian[] = { + 4, + 0x10a0, 0x10c5, + 0x10d0, 0x10fa, + 0x10fc, 0x10fc, + 0x2d00, 0x2d25, +}; /* CR_Georgian */ + +/* 'Hangul': Script */ +static const OnigCodePoint CR_Hangul[] = { + 13, + 0x1100, 0x11ff, + 0x3131, 0x318e, + 0x3200, 0x321e, + 0x3260, 0x327e, + 0xa960, 0xa97c, + 0xac00, 0xd7a3, + 0xd7b0, 0xd7c6, + 0xd7cb, 0xd7fb, + 0xffa0, 0xffbe, + 0xffc2, 0xffc7, + 0xffca, 0xffcf, + 0xffd2, 0xffd7, + 0xffda, 0xffdc, +}; /* CR_Hangul */ + +/* 'Ethiopic': Script */ +static const OnigCodePoint CR_Ethiopic[] = { + 27, + 0x1200, 0x1248, + 0x124a, 0x124d, + 0x1250, 0x1256, + 0x1258, 0x1258, + 0x125a, 0x125d, + 0x1260, 0x1288, + 0x128a, 0x128d, + 0x1290, 0x12b0, + 0x12b2, 0x12b5, + 0x12b8, 0x12be, + 0x12c0, 0x12c0, + 0x12c2, 0x12c5, + 0x12c8, 0x12d6, + 0x12d8, 0x1310, + 0x1312, 0x1315, + 0x1318, 0x135a, + 0x135f, 0x137c, + 0x1380, 0x1399, + 0x2d80, 0x2d96, + 0x2da0, 0x2da6, + 0x2da8, 0x2dae, + 0x2db0, 0x2db6, + 0x2db8, 0x2dbe, + 0x2dc0, 0x2dc6, + 0x2dc8, 0x2dce, + 0x2dd0, 0x2dd6, + 0x2dd8, 0x2dde, +}; /* CR_Ethiopic */ + +/* 'Cherokee': Script */ +static const OnigCodePoint CR_Cherokee[] = { + 1, + 0x13a0, 0x13f4, +}; /* CR_Cherokee */ + +/* 'Canadian_Aboriginal': Script */ +static const OnigCodePoint CR_Canadian_Aboriginal[] = { + 2, + 0x1400, 0x167f, + 0x18b0, 0x18f5, +}; /* CR_Canadian_Aboriginal */ + +/* 'Ogham': Script */ +static const OnigCodePoint CR_Ogham[] = { + 1, + 0x1680, 0x169c, +}; /* CR_Ogham */ + +/* 'Runic': Script */ +static const OnigCodePoint CR_Runic[] = { + 2, + 0x16a0, 0x16ea, + 0x16ee, 0x16f0, +}; /* CR_Runic */ + +/* 'Khmer': Script */ +static const OnigCodePoint CR_Khmer[] = { + 4, + 0x1780, 0x17dd, + 0x17e0, 0x17e9, + 0x17f0, 0x17f9, + 0x19e0, 0x19ff, +}; /* CR_Khmer */ + +/* 'Mongolian': Script */ +static const OnigCodePoint CR_Mongolian[] = { + 6, + 0x1800, 0x1801, + 0x1804, 0x1804, + 0x1806, 0x180e, + 0x1810, 0x1819, + 0x1820, 0x1877, + 0x1880, 0x18aa, +}; /* CR_Mongolian */ + +/* 'Hiragana': Script */ +static const OnigCodePoint CR_Hiragana[] = { + 3, + 0x3041, 0x3096, + 0x309d, 0x309f, + 0x1f200, 0x1f200, +}; /* CR_Hiragana */ + +/* 'Katakana': Script */ +static const OnigCodePoint CR_Katakana[] = { + 7, + 0x30a1, 0x30fa, + 0x30fd, 0x30ff, + 0x31f0, 0x31ff, + 0x32d0, 0x32fe, + 0x3300, 0x3357, + 0xff66, 0xff6f, + 0xff71, 0xff9d, +}; /* CR_Katakana */ + +/* 'Bopomofo': Script */ +static const OnigCodePoint CR_Bopomofo[] = { + 2, + 0x3105, 0x312d, + 0x31a0, 0x31b7, +}; /* CR_Bopomofo */ + +/* 'Han': Script */ +static const OnigCodePoint CR_Han[] = { + 15, + 0x2e80, 0x2e99, + 0x2e9b, 0x2ef3, + 0x2f00, 0x2fd5, + 0x3005, 0x3005, + 0x3007, 0x3007, + 0x3021, 0x3029, + 0x3038, 0x303b, + 0x3400, 0x4db5, + 0x4e00, 0x9fcb, + 0xf900, 0xfa2d, + 0xfa30, 0xfa6d, + 0xfa70, 0xfad9, + 0x20000, 0x2a6d6, + 0x2a700, 0x2b734, + 0x2f800, 0x2fa1d, +}; /* CR_Han */ + +/* 'Yi': Script */ +static const OnigCodePoint CR_Yi[] = { + 2, + 0xa000, 0xa48c, + 0xa490, 0xa4c6, +}; /* CR_Yi */ + +/* 'Old_Italic': Script */ +static const OnigCodePoint CR_Old_Italic[] = { + 2, + 0x10300, 0x1031e, + 0x10320, 0x10323, +}; /* CR_Old_Italic */ + +/* 'Gothic': Script */ +static const OnigCodePoint CR_Gothic[] = { + 1, + 0x10330, 0x1034a, +}; /* CR_Gothic */ + +/* 'Deseret': Script */ +static const OnigCodePoint CR_Deseret[] = { + 1, + 0x10400, 0x1044f, +}; /* CR_Deseret */ + +/* 'Inherited': Script */ +static const OnigCodePoint CR_Inherited[] = { + 23, + 0x0300, 0x036f, + 0x0485, 0x0486, + 0x064b, 0x0655, + 0x0670, 0x0670, + 0x0951, 0x0952, + 0x1cd0, 0x1cd2, + 0x1cd4, 0x1ce0, + 0x1ce2, 0x1ce8, + 0x1ced, 0x1ced, + 0x1dc0, 0x1de6, + 0x1dfd, 0x1dff, + 0x200c, 0x200d, + 0x20d0, 0x20f0, + 0x302a, 0x302f, + 0x3099, 0x309a, + 0xfe00, 0xfe0f, + 0xfe20, 0xfe26, + 0x101fd, 0x101fd, + 0x1d167, 0x1d169, + 0x1d17b, 0x1d182, + 0x1d185, 0x1d18b, + 0x1d1aa, 0x1d1ad, + 0xe0100, 0xe01ef, +}; /* CR_Inherited */ + +/* 'Tagalog': Script */ +static const OnigCodePoint CR_Tagalog[] = { + 2, + 0x1700, 0x170c, + 0x170e, 0x1714, +}; /* CR_Tagalog */ + +/* 'Hanunoo': Script */ +static const OnigCodePoint CR_Hanunoo[] = { + 1, + 0x1720, 0x1734, +}; /* CR_Hanunoo */ + +/* 'Buhid': Script */ +static const OnigCodePoint CR_Buhid[] = { + 1, + 0x1740, 0x1753, +}; /* CR_Buhid */ + +/* 'Tagbanwa': Script */ +static const OnigCodePoint CR_Tagbanwa[] = { + 3, + 0x1760, 0x176c, + 0x176e, 0x1770, + 0x1772, 0x1773, +}; /* CR_Tagbanwa */ + +/* 'Limbu': Script */ +static const OnigCodePoint CR_Limbu[] = { + 5, + 0x1900, 0x191c, + 0x1920, 0x192b, + 0x1930, 0x193b, + 0x1940, 0x1940, + 0x1944, 0x194f, +}; /* CR_Limbu */ + +/* 'Tai_Le': Script */ +static const OnigCodePoint CR_Tai_Le[] = { + 2, + 0x1950, 0x196d, + 0x1970, 0x1974, +}; /* CR_Tai_Le */ + +/* 'Linear_B': Script */ +static const OnigCodePoint CR_Linear_B[] = { + 7, + 0x10000, 0x1000b, + 0x1000d, 0x10026, + 0x10028, 0x1003a, + 0x1003c, 0x1003d, + 0x1003f, 0x1004d, + 0x10050, 0x1005d, + 0x10080, 0x100fa, +}; /* CR_Linear_B */ + +/* 'Ugaritic': Script */ +static const OnigCodePoint CR_Ugaritic[] = { + 2, + 0x10380, 0x1039d, + 0x1039f, 0x1039f, +}; /* CR_Ugaritic */ + +/* 'Shavian': Script */ +static const OnigCodePoint CR_Shavian[] = { + 1, + 0x10450, 0x1047f, +}; /* CR_Shavian */ + +/* 'Osmanya': Script */ +static const OnigCodePoint CR_Osmanya[] = { + 2, + 0x10480, 0x1049d, + 0x104a0, 0x104a9, +}; /* CR_Osmanya */ + +/* 'Cypriot': Script */ +static const OnigCodePoint CR_Cypriot[] = { + 6, + 0x10800, 0x10805, + 0x10808, 0x10808, + 0x1080a, 0x10835, + 0x10837, 0x10838, + 0x1083c, 0x1083c, + 0x1083f, 0x1083f, +}; /* CR_Cypriot */ + +/* 'Braille': Script */ +static const OnigCodePoint CR_Braille[] = { + 1, + 0x2800, 0x28ff, +}; /* CR_Braille */ + +/* 'Buginese': Script */ +static const OnigCodePoint CR_Buginese[] = { + 2, + 0x1a00, 0x1a1b, + 0x1a1e, 0x1a1f, +}; /* CR_Buginese */ + +/* 'Coptic': Script */ +static const OnigCodePoint CR_Coptic[] = { + 3, + 0x03e2, 0x03ef, + 0x2c80, 0x2cf1, + 0x2cf9, 0x2cff, +}; /* CR_Coptic */ + +/* 'New_Tai_Lue': Script */ +static const OnigCodePoint CR_New_Tai_Lue[] = { + 4, + 0x1980, 0x19ab, + 0x19b0, 0x19c9, + 0x19d0, 0x19da, + 0x19de, 0x19df, +}; /* CR_New_Tai_Lue */ + +/* 'Glagolitic': Script */ +static const OnigCodePoint CR_Glagolitic[] = { + 2, + 0x2c00, 0x2c2e, + 0x2c30, 0x2c5e, +}; /* CR_Glagolitic */ + +/* 'Tifinagh': Script */ +static const OnigCodePoint CR_Tifinagh[] = { + 2, + 0x2d30, 0x2d65, + 0x2d6f, 0x2d6f, +}; /* CR_Tifinagh */ + +/* 'Syloti_Nagri': Script */ +static const OnigCodePoint CR_Syloti_Nagri[] = { + 1, + 0xa800, 0xa82b, +}; /* CR_Syloti_Nagri */ + +/* 'Old_Persian': Script */ +static const OnigCodePoint CR_Old_Persian[] = { + 2, + 0x103a0, 0x103c3, + 0x103c8, 0x103d5, +}; /* CR_Old_Persian */ + +/* 'Kharoshthi': Script */ +static const OnigCodePoint CR_Kharoshthi[] = { + 8, + 0x10a00, 0x10a03, + 0x10a05, 0x10a06, + 0x10a0c, 0x10a13, + 0x10a15, 0x10a17, + 0x10a19, 0x10a33, + 0x10a38, 0x10a3a, + 0x10a3f, 0x10a47, + 0x10a50, 0x10a58, +}; /* CR_Kharoshthi */ + +/* 'Balinese': Script */ +static const OnigCodePoint CR_Balinese[] = { + 2, + 0x1b00, 0x1b4b, + 0x1b50, 0x1b7c, +}; /* CR_Balinese */ + +/* 'Cuneiform': Script */ +static const OnigCodePoint CR_Cuneiform[] = { + 3, + 0x12000, 0x1236e, + 0x12400, 0x12462, + 0x12470, 0x12473, +}; /* CR_Cuneiform */ + +/* 'Phoenician': Script */ +static const OnigCodePoint CR_Phoenician[] = { + 2, + 0x10900, 0x1091b, + 0x1091f, 0x1091f, +}; /* CR_Phoenician */ + +/* 'Phags_Pa': Script */ +static const OnigCodePoint CR_Phags_Pa[] = { + 1, + 0xa840, 0xa877, +}; /* CR_Phags_Pa */ + +/* 'Nko': Script */ +static const OnigCodePoint CR_Nko[] = { + 1, + 0x07c0, 0x07fa, +}; /* CR_Nko */ + +/* 'Sundanese': Script */ +static const OnigCodePoint CR_Sundanese[] = { + 2, + 0x1b80, 0x1baa, + 0x1bae, 0x1bb9, +}; /* CR_Sundanese */ + +/* 'Lepcha': Script */ +static const OnigCodePoint CR_Lepcha[] = { + 3, + 0x1c00, 0x1c37, + 0x1c3b, 0x1c49, + 0x1c4d, 0x1c4f, +}; /* CR_Lepcha */ + +/* 'Ol_Chiki': Script */ +static const OnigCodePoint CR_Ol_Chiki[] = { + 1, + 0x1c50, 0x1c7f, +}; /* CR_Ol_Chiki */ + +/* 'Vai': Script */ +static const OnigCodePoint CR_Vai[] = { + 1, + 0xa500, 0xa62b, +}; /* CR_Vai */ + +/* 'Saurashtra': Script */ +static const OnigCodePoint CR_Saurashtra[] = { + 2, + 0xa880, 0xa8c4, + 0xa8ce, 0xa8d9, +}; /* CR_Saurashtra */ + +/* 'Kayah_Li': Script */ +static const OnigCodePoint CR_Kayah_Li[] = { + 1, + 0xa900, 0xa92f, +}; /* CR_Kayah_Li */ + +/* 'Rejang': Script */ +static const OnigCodePoint CR_Rejang[] = { + 2, + 0xa930, 0xa953, + 0xa95f, 0xa95f, +}; /* CR_Rejang */ + +/* 'Lycian': Script */ +static const OnigCodePoint CR_Lycian[] = { + 1, + 0x10280, 0x1029c, +}; /* CR_Lycian */ + +/* 'Carian': Script */ +static const OnigCodePoint CR_Carian[] = { + 1, + 0x102a0, 0x102d0, +}; /* CR_Carian */ + +/* 'Lydian': Script */ +static const OnigCodePoint CR_Lydian[] = { + 2, + 0x10920, 0x10939, + 0x1093f, 0x1093f, +}; /* CR_Lydian */ + +/* 'Cham': Script */ +static const OnigCodePoint CR_Cham[] = { + 4, + 0xaa00, 0xaa36, + 0xaa40, 0xaa4d, + 0xaa50, 0xaa59, + 0xaa5c, 0xaa5f, +}; /* CR_Cham */ + +/* 'Tai_Tham': Script */ +static const OnigCodePoint CR_Tai_Tham[] = { + 5, + 0x1a20, 0x1a5e, + 0x1a60, 0x1a7c, + 0x1a7f, 0x1a89, + 0x1a90, 0x1a99, + 0x1aa0, 0x1aad, +}; /* CR_Tai_Tham */ + +/* 'Tai_Viet': Script */ +static const OnigCodePoint CR_Tai_Viet[] = { + 2, + 0xaa80, 0xaac2, + 0xaadb, 0xaadf, +}; /* CR_Tai_Viet */ + +/* 'Avestan': Script */ +static const OnigCodePoint CR_Avestan[] = { + 2, + 0x10b00, 0x10b35, + 0x10b39, 0x10b3f, +}; /* CR_Avestan */ + +/* 'Egyptian_Hieroglyphs': Script */ +static const OnigCodePoint CR_Egyptian_Hieroglyphs[] = { + 1, + 0x13000, 0x1342e, +}; /* CR_Egyptian_Hieroglyphs */ + +/* 'Samaritan': Script */ +static const OnigCodePoint CR_Samaritan[] = { + 2, + 0x0800, 0x082d, + 0x0830, 0x083e, +}; /* CR_Samaritan */ + +/* 'Lisu': Script */ +static const OnigCodePoint CR_Lisu[] = { + 1, + 0xa4d0, 0xa4ff, +}; /* CR_Lisu */ + +/* 'Bamum': Script */ +static const OnigCodePoint CR_Bamum[] = { + 1, + 0xa6a0, 0xa6f7, +}; /* CR_Bamum */ + +/* 'Javanese': Script */ +static const OnigCodePoint CR_Javanese[] = { + 3, + 0xa980, 0xa9cd, + 0xa9cf, 0xa9d9, + 0xa9de, 0xa9df, +}; /* CR_Javanese */ + +/* 'Meetei_Mayek': Script */ +static const OnigCodePoint CR_Meetei_Mayek[] = { + 2, + 0xabc0, 0xabed, + 0xabf0, 0xabf9, +}; /* CR_Meetei_Mayek */ + +/* 'Imperial_Aramaic': Script */ +static const OnigCodePoint CR_Imperial_Aramaic[] = { + 2, + 0x10840, 0x10855, + 0x10857, 0x1085f, +}; /* CR_Imperial_Aramaic */ + +/* 'Old_South_Arabian': Script */ +static const OnigCodePoint CR_Old_South_Arabian[] = { + 1, + 0x10a60, 0x10a7f, +}; /* CR_Old_South_Arabian */ + +/* 'Inscriptional_Parthian': Script */ +static const OnigCodePoint CR_Inscriptional_Parthian[] = { + 2, + 0x10b40, 0x10b55, + 0x10b58, 0x10b5f, +}; /* CR_Inscriptional_Parthian */ + +/* 'Inscriptional_Pahlavi': Script */ +static const OnigCodePoint CR_Inscriptional_Pahlavi[] = { + 2, + 0x10b60, 0x10b72, + 0x10b78, 0x10b7f, +}; /* CR_Inscriptional_Pahlavi */ + +/* 'Old_Turkic': Script */ +static const OnigCodePoint CR_Old_Turkic[] = { + 1, + 0x10c00, 0x10c48, +}; /* CR_Old_Turkic */ + +/* 'Kaithi': Script */ +static const OnigCodePoint CR_Kaithi[] = { + 1, + 0x11080, 0x110c1, +}; /* CR_Kaithi */ + +/* 'White_Space': Binary Property */ +static const OnigCodePoint CR_White_Space[] = { + 11, + 0x0009, 0x000d, + 0x0020, 0x0020, + 0x0085, 0x0085, + 0x00a0, 0x00a0, + 0x1680, 0x1680, + 0x180e, 0x180e, + 0x2000, 0x200a, + 0x2028, 0x2029, + 0x202f, 0x202f, + 0x205f, 0x205f, + 0x3000, 0x3000, +}; /* CR_White_Space */ + +/* 'Bidi_Control': Binary Property */ +static const OnigCodePoint CR_Bidi_Control[] = { + 2, + 0x200e, 0x200f, + 0x202a, 0x202e, +}; /* CR_Bidi_Control */ + +/* 'Join_Control': Binary Property */ +static const OnigCodePoint CR_Join_Control[] = { + 1, + 0x200c, 0x200d, +}; /* CR_Join_Control */ + +/* 'Dash': Binary Property */ +static const OnigCodePoint CR_Dash[] = { + 19, + 0x002d, 0x002d, + 0x058a, 0x058a, + 0x05be, 0x05be, + 0x1400, 0x1400, + 0x1806, 0x1806, + 0x2010, 0x2015, + 0x2053, 0x2053, + 0x207b, 0x207b, + 0x208b, 0x208b, + 0x2212, 0x2212, + 0x2e17, 0x2e17, + 0x2e1a, 0x2e1a, + 0x301c, 0x301c, + 0x3030, 0x3030, + 0x30a0, 0x30a0, + 0xfe31, 0xfe32, + 0xfe58, 0xfe58, + 0xfe63, 0xfe63, + 0xff0d, 0xff0d, +}; /* CR_Dash */ + +/* 'Hyphen': Binary Property */ +static const OnigCodePoint CR_Hyphen[] = { + 10, + 0x002d, 0x002d, + 0x00ad, 0x00ad, + 0x058a, 0x058a, + 0x1806, 0x1806, + 0x2010, 0x2011, + 0x2e17, 0x2e17, + 0x30fb, 0x30fb, + 0xfe63, 0xfe63, + 0xff0d, 0xff0d, + 0xff65, 0xff65, +}; /* CR_Hyphen */ + +/* 'Quotation_Mark': Binary Property */ +static const OnigCodePoint CR_Quotation_Mark[] = { + 12, + 0x0022, 0x0022, + 0x0027, 0x0027, + 0x00ab, 0x00ab, + 0x00bb, 0x00bb, + 0x2018, 0x201f, + 0x2039, 0x203a, + 0x300c, 0x300f, + 0x301d, 0x301f, + 0xfe41, 0xfe44, + 0xff02, 0xff02, + 0xff07, 0xff07, + 0xff62, 0xff63, +}; /* CR_Quotation_Mark */ + +/* 'Terminal_Punctuation': Binary Property */ +static const OnigCodePoint CR_Terminal_Punctuation[] = { + 65, + 0x0021, 0x0021, + 0x002c, 0x002c, + 0x002e, 0x002e, + 0x003a, 0x003b, + 0x003f, 0x003f, + 0x037e, 0x037e, + 0x0387, 0x0387, + 0x0589, 0x0589, + 0x05c3, 0x05c3, + 0x060c, 0x060c, + 0x061b, 0x061b, + 0x061f, 0x061f, + 0x06d4, 0x06d4, + 0x0700, 0x070a, + 0x070c, 0x070c, + 0x07f8, 0x07f9, + 0x0830, 0x083e, + 0x0964, 0x0965, + 0x0e5a, 0x0e5b, + 0x0f08, 0x0f08, + 0x0f0d, 0x0f12, + 0x104a, 0x104b, + 0x1361, 0x1368, + 0x166d, 0x166e, + 0x16eb, 0x16ed, + 0x17d4, 0x17d6, + 0x17da, 0x17da, + 0x1802, 0x1805, + 0x1808, 0x1809, + 0x1944, 0x1945, + 0x1aa8, 0x1aab, + 0x1b5a, 0x1b5b, + 0x1b5d, 0x1b5f, + 0x1c3b, 0x1c3f, + 0x1c7e, 0x1c7f, + 0x203c, 0x203d, + 0x2047, 0x2049, + 0x2e2e, 0x2e2e, + 0x3001, 0x3002, + 0xa4fe, 0xa4ff, + 0xa60d, 0xa60f, + 0xa6f3, 0xa6f7, + 0xa876, 0xa877, + 0xa8ce, 0xa8cf, + 0xa92f, 0xa92f, + 0xa9c7, 0xa9c9, + 0xaa5d, 0xaa5f, + 0xaadf, 0xaadf, + 0xabeb, 0xabeb, + 0xfe50, 0xfe52, + 0xfe54, 0xfe57, + 0xff01, 0xff01, + 0xff0c, 0xff0c, + 0xff0e, 0xff0e, + 0xff1a, 0xff1b, + 0xff1f, 0xff1f, + 0xff61, 0xff61, + 0xff64, 0xff64, + 0x1039f, 0x1039f, + 0x103d0, 0x103d0, + 0x10857, 0x10857, + 0x1091f, 0x1091f, + 0x10b3a, 0x10b3f, + 0x110be, 0x110c1, + 0x12470, 0x12473, +}; /* CR_Terminal_Punctuation */ + +/* 'Other_Math': Binary Property */ +static const OnigCodePoint CR_Other_Math[] = { + 99, + 0x005e, 0x005e, + 0x03d0, 0x03d2, + 0x03d5, 0x03d5, + 0x03f0, 0x03f1, + 0x03f4, 0x03f5, + 0x2016, 0x2016, + 0x2032, 0x2034, + 0x2040, 0x2040, + 0x2061, 0x2064, + 0x207d, 0x207e, + 0x208d, 0x208e, + 0x20d0, 0x20dc, + 0x20e1, 0x20e1, + 0x20e5, 0x20e6, + 0x20eb, 0x20ef, + 0x2102, 0x2102, + 0x210a, 0x2113, + 0x2115, 0x2115, + 0x2119, 0x211d, + 0x2124, 0x2124, + 0x2128, 0x2129, + 0x212c, 0x212d, + 0x212f, 0x2131, + 0x2133, 0x2138, + 0x213c, 0x213f, + 0x2145, 0x2149, + 0x2195, 0x2199, + 0x219c, 0x219f, + 0x21a1, 0x21a2, + 0x21a4, 0x21a5, + 0x21a7, 0x21a7, + 0x21a9, 0x21ad, + 0x21b0, 0x21b1, + 0x21b6, 0x21b7, + 0x21bc, 0x21cd, + 0x21d0, 0x21d1, + 0x21d3, 0x21d3, + 0x21d5, 0x21db, + 0x21dd, 0x21dd, + 0x21e4, 0x21e5, + 0x23b4, 0x23b5, + 0x23b7, 0x23b7, + 0x23d0, 0x23d0, + 0x23e2, 0x23e2, + 0x25a0, 0x25a1, + 0x25ae, 0x25b6, + 0x25bc, 0x25c0, + 0x25c6, 0x25c7, + 0x25ca, 0x25cb, + 0x25cf, 0x25d3, + 0x25e2, 0x25e2, + 0x25e4, 0x25e4, + 0x25e7, 0x25ec, + 0x2605, 0x2606, + 0x2640, 0x2640, + 0x2642, 0x2642, + 0x2660, 0x2663, + 0x266d, 0x266e, + 0x27c5, 0x27c6, + 0x27e6, 0x27ef, + 0x2983, 0x2998, + 0x29d8, 0x29db, + 0x29fc, 0x29fd, + 0xfe61, 0xfe61, + 0xfe63, 0xfe63, + 0xfe68, 0xfe68, + 0xff3c, 0xff3c, + 0xff3e, 0xff3e, + 0x1d400, 0x1d454, + 0x1d456, 0x1d49c, + 0x1d49e, 0x1d49f, + 0x1d4a2, 0x1d4a2, + 0x1d4a5, 0x1d4a6, + 0x1d4a9, 0x1d4ac, + 0x1d4ae, 0x1d4b9, + 0x1d4bb, 0x1d4bb, + 0x1d4bd, 0x1d4c3, + 0x1d4c5, 0x1d505, + 0x1d507, 0x1d50a, + 0x1d50d, 0x1d514, + 0x1d516, 0x1d51c, + 0x1d51e, 0x1d539, + 0x1d53b, 0x1d53e, + 0x1d540, 0x1d544, + 0x1d546, 0x1d546, + 0x1d54a, 0x1d550, + 0x1d552, 0x1d6a5, + 0x1d6a8, 0x1d6c0, + 0x1d6c2, 0x1d6da, + 0x1d6dc, 0x1d6fa, + 0x1d6fc, 0x1d714, + 0x1d716, 0x1d734, + 0x1d736, 0x1d74e, + 0x1d750, 0x1d76e, + 0x1d770, 0x1d788, + 0x1d78a, 0x1d7a8, + 0x1d7aa, 0x1d7c2, + 0x1d7c4, 0x1d7cb, + 0x1d7ce, 0x1d7ff, +}; /* CR_Other_Math */ + +/* 'Hex_Digit': Binary Property */ +static const OnigCodePoint CR_Hex_Digit[] = { + 6, + 0x0030, 0x0039, + 0x0041, 0x0046, + 0x0061, 0x0066, + 0xff10, 0xff19, + 0xff21, 0xff26, + 0xff41, 0xff46, +}; /* CR_Hex_Digit */ + +/* 'ASCII_Hex_Digit': Binary Property */ +static const OnigCodePoint CR_ASCII_Hex_Digit[] = { + 3, + 0x0030, 0x0039, + 0x0041, 0x0046, + 0x0061, 0x0066, +}; /* CR_ASCII_Hex_Digit */ + +/* 'Other_Alphabetic': Binary Property */ +static const OnigCodePoint CR_Other_Alphabetic[] = { + 141, + 0x0345, 0x0345, + 0x05b0, 0x05bd, + 0x05bf, 0x05bf, + 0x05c1, 0x05c2, + 0x05c4, 0x05c5, + 0x05c7, 0x05c7, + 0x0610, 0x061a, + 0x064b, 0x0657, + 0x0659, 0x065e, + 0x0670, 0x0670, + 0x06d6, 0x06dc, + 0x06e1, 0x06e4, + 0x06e7, 0x06e8, + 0x06ed, 0x06ed, + 0x0711, 0x0711, + 0x0730, 0x073f, + 0x07a6, 0x07b0, + 0x0816, 0x0817, + 0x081b, 0x0823, + 0x0825, 0x0827, + 0x0829, 0x082c, + 0x0900, 0x0903, + 0x093e, 0x094c, + 0x094e, 0x094e, + 0x0955, 0x0955, + 0x0962, 0x0963, + 0x0981, 0x0983, + 0x09be, 0x09c4, + 0x09c7, 0x09c8, + 0x09cb, 0x09cc, + 0x09d7, 0x09d7, + 0x09e2, 0x09e3, + 0x0a01, 0x0a03, + 0x0a3e, 0x0a42, + 0x0a47, 0x0a48, + 0x0a4b, 0x0a4c, + 0x0a51, 0x0a51, + 0x0a70, 0x0a71, + 0x0a75, 0x0a75, + 0x0a81, 0x0a83, + 0x0abe, 0x0ac5, + 0x0ac7, 0x0ac9, + 0x0acb, 0x0acc, + 0x0ae2, 0x0ae3, + 0x0b01, 0x0b03, + 0x0b3e, 0x0b44, + 0x0b47, 0x0b48, + 0x0b4b, 0x0b4c, + 0x0b56, 0x0b57, + 0x0b62, 0x0b63, + 0x0b82, 0x0b82, + 0x0bbe, 0x0bc2, + 0x0bc6, 0x0bc8, + 0x0bca, 0x0bcc, + 0x0bd7, 0x0bd7, + 0x0c01, 0x0c03, + 0x0c3e, 0x0c44, + 0x0c46, 0x0c48, + 0x0c4a, 0x0c4c, + 0x0c55, 0x0c56, + 0x0c62, 0x0c63, + 0x0c82, 0x0c83, + 0x0cbe, 0x0cc4, + 0x0cc6, 0x0cc8, + 0x0cca, 0x0ccc, + 0x0cd5, 0x0cd6, + 0x0ce2, 0x0ce3, + 0x0d02, 0x0d03, + 0x0d3e, 0x0d44, + 0x0d46, 0x0d48, + 0x0d4a, 0x0d4c, + 0x0d57, 0x0d57, + 0x0d62, 0x0d63, + 0x0d82, 0x0d83, + 0x0dcf, 0x0dd4, + 0x0dd6, 0x0dd6, + 0x0dd8, 0x0ddf, + 0x0df2, 0x0df3, + 0x0e31, 0x0e31, + 0x0e34, 0x0e3a, + 0x0e4d, 0x0e4d, + 0x0eb1, 0x0eb1, + 0x0eb4, 0x0eb9, + 0x0ebb, 0x0ebc, + 0x0ecd, 0x0ecd, + 0x0f71, 0x0f81, + 0x0f90, 0x0f97, + 0x0f99, 0x0fbc, + 0x102b, 0x1036, + 0x1038, 0x1038, + 0x103b, 0x103e, + 0x1056, 0x1059, + 0x105e, 0x1060, + 0x1062, 0x1062, + 0x1067, 0x1068, + 0x1071, 0x1074, + 0x1082, 0x1086, + 0x109c, 0x109d, + 0x135f, 0x135f, + 0x1712, 0x1713, + 0x1732, 0x1733, + 0x1752, 0x1753, + 0x1772, 0x1773, + 0x17b6, 0x17c8, + 0x18a9, 0x18a9, + 0x1920, 0x192b, + 0x1930, 0x1938, + 0x19b0, 0x19c0, + 0x19c8, 0x19c9, + 0x1a17, 0x1a1b, + 0x1a55, 0x1a5e, + 0x1a61, 0x1a74, + 0x1b00, 0x1b04, + 0x1b35, 0x1b43, + 0x1b80, 0x1b82, + 0x1ba1, 0x1ba9, + 0x1c24, 0x1c35, + 0x1cf2, 0x1cf2, + 0x24b6, 0x24e9, + 0x2de0, 0x2dff, + 0xa823, 0xa827, + 0xa880, 0xa881, + 0xa8b4, 0xa8c3, + 0xa926, 0xa92a, + 0xa947, 0xa952, + 0xa980, 0xa983, + 0xa9b3, 0xa9bf, + 0xaa29, 0xaa36, + 0xaa43, 0xaa43, + 0xaa4c, 0xaa4d, + 0xaab0, 0xaab0, + 0xaab2, 0xaab4, + 0xaab7, 0xaab8, + 0xaabe, 0xaabe, + 0xabe3, 0xabea, + 0xfb1e, 0xfb1e, + 0x10a01, 0x10a03, + 0x10a05, 0x10a06, + 0x10a0c, 0x10a0f, + 0x11082, 0x11082, + 0x110b0, 0x110b8, +}; /* CR_Other_Alphabetic */ + +/* 'Ideographic': Binary Property */ +static const OnigCodePoint CR_Ideographic[] = { + 11, + 0x3006, 0x3007, + 0x3021, 0x3029, + 0x3038, 0x303a, + 0x3400, 0x4db5, + 0x4e00, 0x9fcb, + 0xf900, 0xfa2d, + 0xfa30, 0xfa6d, + 0xfa70, 0xfad9, + 0x20000, 0x2a6d6, + 0x2a700, 0x2b734, + 0x2f800, 0x2fa1d, +}; /* CR_Ideographic */ + +/* 'Diacritic': Binary Property */ +static const OnigCodePoint CR_Diacritic[] = { + 117, + 0x005e, 0x005e, + 0x0060, 0x0060, + 0x00a8, 0x00a8, + 0x00af, 0x00af, + 0x00b4, 0x00b4, + 0x00b7, 0x00b8, + 0x02b0, 0x034e, + 0x0350, 0x0357, + 0x035d, 0x0362, + 0x0374, 0x0375, + 0x037a, 0x037a, + 0x0384, 0x0385, + 0x0483, 0x0487, + 0x0559, 0x0559, + 0x0591, 0x05a1, + 0x05a3, 0x05bd, + 0x05bf, 0x05bf, + 0x05c1, 0x05c2, + 0x05c4, 0x05c4, + 0x064b, 0x0652, + 0x0657, 0x0658, + 0x06df, 0x06e0, + 0x06e5, 0x06e6, + 0x06ea, 0x06ec, + 0x0730, 0x074a, + 0x07a6, 0x07b0, + 0x07eb, 0x07f5, + 0x0818, 0x0819, + 0x093c, 0x093c, + 0x094d, 0x094d, + 0x0951, 0x0954, + 0x0971, 0x0971, + 0x09bc, 0x09bc, + 0x09cd, 0x09cd, + 0x0a3c, 0x0a3c, + 0x0a4d, 0x0a4d, + 0x0abc, 0x0abc, + 0x0acd, 0x0acd, + 0x0b3c, 0x0b3c, + 0x0b4d, 0x0b4d, + 0x0bcd, 0x0bcd, + 0x0c4d, 0x0c4d, + 0x0cbc, 0x0cbc, + 0x0ccd, 0x0ccd, + 0x0d4d, 0x0d4d, + 0x0dca, 0x0dca, + 0x0e47, 0x0e4c, + 0x0e4e, 0x0e4e, + 0x0ec8, 0x0ecc, + 0x0f18, 0x0f19, + 0x0f35, 0x0f35, + 0x0f37, 0x0f37, + 0x0f39, 0x0f39, + 0x0f3e, 0x0f3f, + 0x0f82, 0x0f84, + 0x0f86, 0x0f87, + 0x0fc6, 0x0fc6, + 0x1037, 0x1037, + 0x1039, 0x103a, + 0x1087, 0x108d, + 0x108f, 0x108f, + 0x109a, 0x109b, + 0x17c9, 0x17d3, + 0x17dd, 0x17dd, + 0x1939, 0x193b, + 0x1a75, 0x1a7c, + 0x1a7f, 0x1a7f, + 0x1b34, 0x1b34, + 0x1b44, 0x1b44, + 0x1b6b, 0x1b73, + 0x1baa, 0x1baa, + 0x1c36, 0x1c37, + 0x1c78, 0x1c7d, + 0x1cd0, 0x1ce8, + 0x1ced, 0x1ced, + 0x1d2c, 0x1d6a, + 0x1dc4, 0x1dcf, + 0x1dfd, 0x1dff, + 0x1fbd, 0x1fbd, + 0x1fbf, 0x1fc1, + 0x1fcd, 0x1fcf, + 0x1fdd, 0x1fdf, + 0x1fed, 0x1fef, + 0x1ffd, 0x1ffe, + 0x2cef, 0x2cf1, + 0x2e2f, 0x2e2f, + 0x302a, 0x302f, + 0x3099, 0x309c, + 0x30fc, 0x30fc, + 0xa66f, 0xa66f, + 0xa67c, 0xa67d, + 0xa67f, 0xa67f, + 0xa6f0, 0xa6f1, + 0xa717, 0xa721, + 0xa788, 0xa788, + 0xa8c4, 0xa8c4, + 0xa8e0, 0xa8f1, + 0xa92b, 0xa92e, + 0xa953, 0xa953, + 0xa9b3, 0xa9b3, + 0xa9c0, 0xa9c0, + 0xaa7b, 0xaa7b, + 0xaabf, 0xaac2, + 0xabec, 0xabed, + 0xfb1e, 0xfb1e, + 0xfe20, 0xfe26, + 0xff3e, 0xff3e, + 0xff40, 0xff40, + 0xff70, 0xff70, + 0xff9e, 0xff9f, + 0xffe3, 0xffe3, + 0x110b9, 0x110ba, + 0x1d167, 0x1d169, + 0x1d16d, 0x1d172, + 0x1d17b, 0x1d182, + 0x1d185, 0x1d18b, + 0x1d1aa, 0x1d1ad, +}; /* CR_Diacritic */ + +/* 'Extender': Binary Property */ +static const OnigCodePoint CR_Extender[] = { + 20, + 0x00b7, 0x00b7, + 0x02d0, 0x02d1, + 0x0640, 0x0640, + 0x07fa, 0x07fa, + 0x0e46, 0x0e46, + 0x0ec6, 0x0ec6, + 0x1843, 0x1843, + 0x1aa7, 0x1aa7, + 0x1c36, 0x1c36, + 0x1c7b, 0x1c7b, + 0x3005, 0x3005, + 0x3031, 0x3035, + 0x309d, 0x309e, + 0x30fc, 0x30fe, + 0xa015, 0xa015, + 0xa60c, 0xa60c, + 0xa9cf, 0xa9cf, + 0xaa70, 0xaa70, + 0xaadd, 0xaadd, + 0xff70, 0xff70, +}; /* CR_Extender */ + +/* 'Other_Lowercase': Binary Property */ +static const OnigCodePoint CR_Other_Lowercase[] = { + 13, + 0x02b0, 0x02b8, + 0x02c0, 0x02c1, + 0x02e0, 0x02e4, + 0x0345, 0x0345, + 0x037a, 0x037a, + 0x1d2c, 0x1d61, + 0x1d78, 0x1d78, + 0x1d9b, 0x1dbf, + 0x2090, 0x2094, + 0x2170, 0x217f, + 0x24d0, 0x24e9, + 0x2c7d, 0x2c7d, + 0xa770, 0xa770, +}; /* CR_Other_Lowercase */ + +/* 'Other_Uppercase': Binary Property */ +static const OnigCodePoint CR_Other_Uppercase[] = { + 2, + 0x2160, 0x216f, + 0x24b6, 0x24cf, +}; /* CR_Other_Uppercase */ + +/* 'Noncharacter_Code_Point': Binary Property */ +static const OnigCodePoint CR_Noncharacter_Code_Point[] = { + 18, + 0xfdd0, 0xfdef, + 0xfffe, 0xffff, + 0x1fffe, 0x1ffff, + 0x2fffe, 0x2ffff, + 0x3fffe, 0x3ffff, + 0x4fffe, 0x4ffff, + 0x5fffe, 0x5ffff, + 0x6fffe, 0x6ffff, + 0x7fffe, 0x7ffff, + 0x8fffe, 0x8ffff, + 0x9fffe, 0x9ffff, + 0xafffe, 0xaffff, + 0xbfffe, 0xbffff, + 0xcfffe, 0xcffff, + 0xdfffe, 0xdffff, + 0xefffe, 0xeffff, + 0xffffe, 0xfffff, + 0x10fffe, 0x10ffff, +}; /* CR_Noncharacter_Code_Point */ + +/* 'Other_Grapheme_Extend': Binary Property */ +static const OnigCodePoint CR_Other_Grapheme_Extend[] = { + 16, + 0x09be, 0x09be, + 0x09d7, 0x09d7, + 0x0b3e, 0x0b3e, + 0x0b57, 0x0b57, + 0x0bbe, 0x0bbe, + 0x0bd7, 0x0bd7, + 0x0cc2, 0x0cc2, + 0x0cd5, 0x0cd6, + 0x0d3e, 0x0d3e, + 0x0d57, 0x0d57, + 0x0dcf, 0x0dcf, + 0x0ddf, 0x0ddf, + 0x200c, 0x200d, + 0xff9e, 0xff9f, + 0x1d165, 0x1d165, + 0x1d16e, 0x1d172, +}; /* CR_Other_Grapheme_Extend */ + +/* 'IDS_Binary_Operator': Binary Property */ +static const OnigCodePoint CR_IDS_Binary_Operator[] = { + 2, + 0x2ff0, 0x2ff1, + 0x2ff4, 0x2ffb, +}; /* CR_IDS_Binary_Operator */ + +/* 'IDS_Trinary_Operator': Binary Property */ +static const OnigCodePoint CR_IDS_Trinary_Operator[] = { + 1, + 0x2ff2, 0x2ff3, +}; /* CR_IDS_Trinary_Operator */ + +/* 'Radical': Binary Property */ +static const OnigCodePoint CR_Radical[] = { + 3, + 0x2e80, 0x2e99, + 0x2e9b, 0x2ef3, + 0x2f00, 0x2fd5, +}; /* CR_Radical */ + +/* 'Unified_Ideograph': Binary Property */ +static const OnigCodePoint CR_Unified_Ideograph[] = { + 11, + 0x3400, 0x4db5, + 0x4e00, 0x9fcb, + 0xfa0e, 0xfa0f, + 0xfa11, 0xfa11, + 0xfa13, 0xfa14, + 0xfa1f, 0xfa1f, + 0xfa21, 0xfa21, + 0xfa23, 0xfa24, + 0xfa27, 0xfa29, + 0x20000, 0x2a6d6, + 0x2a700, 0x2b734, +}; /* CR_Unified_Ideograph */ + +/* 'Other_Default_Ignorable_Code_Point': Binary Property */ +static const OnigCodePoint CR_Other_Default_Ignorable_Code_Point[] = { + 10, + 0x034f, 0x034f, + 0x115f, 0x1160, + 0x2065, 0x2069, + 0x3164, 0x3164, + 0xffa0, 0xffa0, + 0xfff0, 0xfff8, + 0xe0000, 0xe0000, + 0xe0002, 0xe001f, + 0xe0080, 0xe00ff, + 0xe01f0, 0xe0fff, +}; /* CR_Other_Default_Ignorable_Code_Point */ + +/* 'Deprecated': Binary Property */ +static const OnigCodePoint CR_Deprecated[] = { + 8, + 0x0149, 0x0149, + 0x0f77, 0x0f77, + 0x0f79, 0x0f79, + 0x17a3, 0x17a4, + 0x206a, 0x206f, + 0x2329, 0x232a, + 0xe0001, 0xe0001, + 0xe0020, 0xe007f, +}; /* CR_Deprecated */ + +/* 'Soft_Dotted': Binary Property */ +static const OnigCodePoint CR_Soft_Dotted[] = { + 31, + 0x0069, 0x006a, + 0x012f, 0x012f, + 0x0249, 0x0249, + 0x0268, 0x0268, + 0x029d, 0x029d, + 0x02b2, 0x02b2, + 0x03f3, 0x03f3, + 0x0456, 0x0456, + 0x0458, 0x0458, + 0x1d62, 0x1d62, + 0x1d96, 0x1d96, + 0x1da4, 0x1da4, + 0x1da8, 0x1da8, + 0x1e2d, 0x1e2d, + 0x1ecb, 0x1ecb, + 0x2071, 0x2071, + 0x2148, 0x2149, + 0x2c7c, 0x2c7c, + 0x1d422, 0x1d423, + 0x1d456, 0x1d457, + 0x1d48a, 0x1d48b, + 0x1d4be, 0x1d4bf, + 0x1d4f2, 0x1d4f3, + 0x1d526, 0x1d527, + 0x1d55a, 0x1d55b, + 0x1d58e, 0x1d58f, + 0x1d5c2, 0x1d5c3, + 0x1d5f6, 0x1d5f7, + 0x1d62a, 0x1d62b, + 0x1d65e, 0x1d65f, + 0x1d692, 0x1d693, +}; /* CR_Soft_Dotted */ + +/* 'Logical_Order_Exception': Binary Property */ +static const OnigCodePoint CR_Logical_Order_Exception[] = { + 5, + 0x0e40, 0x0e44, + 0x0ec0, 0x0ec4, + 0xaab5, 0xaab6, + 0xaab9, 0xaab9, + 0xaabb, 0xaabc, +}; /* CR_Logical_Order_Exception */ + +/* 'Other_ID_Start': Binary Property */ +static const OnigCodePoint CR_Other_ID_Start[] = { + 3, + 0x2118, 0x2118, + 0x212e, 0x212e, + 0x309b, 0x309c, +}; /* CR_Other_ID_Start */ + +/* 'Other_ID_Continue': Binary Property */ +static const OnigCodePoint CR_Other_ID_Continue[] = { + 3, + 0x00b7, 0x00b7, + 0x0387, 0x0387, + 0x1369, 0x1371, +}; /* CR_Other_ID_Continue */ + +/* 'STerm': Binary Property */ +static const OnigCodePoint CR_STerm[] = { + 43, + 0x0021, 0x0021, + 0x002e, 0x002e, + 0x003f, 0x003f, + 0x055c, 0x055c, + 0x055e, 0x055e, + 0x0589, 0x0589, + 0x061f, 0x061f, + 0x06d4, 0x06d4, + 0x0700, 0x0702, + 0x07f9, 0x07f9, + 0x0964, 0x0965, + 0x104a, 0x104b, + 0x1362, 0x1362, + 0x1367, 0x1368, + 0x166e, 0x166e, + 0x1803, 0x1803, + 0x1809, 0x1809, + 0x1944, 0x1945, + 0x1b5a, 0x1b5b, + 0x1b5e, 0x1b5f, + 0x1c3b, 0x1c3c, + 0x1c7e, 0x1c7f, + 0x203c, 0x203d, + 0x2047, 0x2049, + 0x2e2e, 0x2e2e, + 0x3002, 0x3002, + 0xa4ff, 0xa4ff, + 0xa60e, 0xa60f, + 0xa6f3, 0xa6f3, + 0xa6f7, 0xa6f7, + 0xa876, 0xa877, + 0xa8ce, 0xa8cf, + 0xa92f, 0xa92f, + 0xa9c8, 0xa9c9, + 0xaa5d, 0xaa5f, + 0xabeb, 0xabeb, + 0xfe52, 0xfe52, + 0xfe56, 0xfe57, + 0xff01, 0xff01, + 0xff0e, 0xff0e, + 0xff1f, 0xff1f, + 0xff61, 0xff61, + 0x110be, 0x110c1, +}; /* CR_STerm */ + +/* 'Variation_Selector': Binary Property */ +static const OnigCodePoint CR_Variation_Selector[] = { + 3, + 0x180b, 0x180d, + 0xfe00, 0xfe0f, + 0xe0100, 0xe01ef, +}; /* CR_Variation_Selector */ + +/* 'Pattern_White_Space': Binary Property */ +static const OnigCodePoint CR_Pattern_White_Space[] = { + 5, + 0x0009, 0x000d, + 0x0020, 0x0020, + 0x0085, 0x0085, + 0x200e, 0x200f, + 0x2028, 0x2029, +}; /* CR_Pattern_White_Space */ + +/* 'Pattern_Syntax': Binary Property */ +static const OnigCodePoint CR_Pattern_Syntax[] = { + 28, + 0x0021, 0x002f, + 0x003a, 0x0040, + 0x005b, 0x005e, + 0x0060, 0x0060, + 0x007b, 0x007e, + 0x00a1, 0x00a7, + 0x00a9, 0x00a9, + 0x00ab, 0x00ac, + 0x00ae, 0x00ae, + 0x00b0, 0x00b1, + 0x00b6, 0x00b6, + 0x00bb, 0x00bb, + 0x00bf, 0x00bf, + 0x00d7, 0x00d7, + 0x00f7, 0x00f7, + 0x2010, 0x2027, + 0x2030, 0x203e, + 0x2041, 0x2053, + 0x2055, 0x205e, + 0x2190, 0x245f, + 0x2500, 0x2775, + 0x2794, 0x2bff, + 0x2e00, 0x2e7f, + 0x3001, 0x3003, + 0x3008, 0x3020, + 0x3030, 0x3030, + 0xfd3e, 0xfd3f, + 0xfe45, 0xfe46, +}; /* CR_Pattern_Syntax */ +#endif /* USE_UNICODE_PROPERTIES */ +#endif /* USE_UNICODE_PROPERTIES */ + +/* 'NEWLINE': [[:NEWLINE:]] */ +static const OnigCodePoint CR_NEWLINE[] = { + 1, + 0x000a, 0x000a, +}; /* CR_NEWLINE */ + +/* 'Alpha': [[:Alpha:]] */ +#define CR_Alpha CR_Alphabetic + +/* 'Blank': [[:Blank:]] */ +static const OnigCodePoint CR_Blank[] = { + 9, + 0x0009, 0x0009, + 0x0020, 0x0020, + 0x00a0, 0x00a0, + 0x1680, 0x1680, + 0x180e, 0x180e, + 0x2000, 0x200a, + 0x202f, 0x202f, + 0x205f, 0x205f, + 0x3000, 0x3000, +}; /* CR_Blank */ + +/* 'Cntrl': [[:Cntrl:]] */ +#define CR_Cntrl CR_Cc + +/* 'Digit': [[:Digit:]] */ +#define CR_Digit CR_Nd + +/* 'Graph': [[:Graph:]] */ +static const OnigCodePoint CR_Graph[] = { + 490, + 0x0021, 0x007e, + 0x00a1, 0x0377, + 0x037a, 0x037e, + 0x0384, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x03a1, + 0x03a3, 0x0525, + 0x0531, 0x0556, + 0x0559, 0x055f, + 0x0561, 0x0587, + 0x0589, 0x058a, + 0x0591, 0x05c7, + 0x05d0, 0x05ea, + 0x05f0, 0x05f4, + 0x0600, 0x0603, + 0x0606, 0x061b, + 0x061e, 0x061f, + 0x0621, 0x065e, + 0x0660, 0x070d, + 0x070f, 0x074a, + 0x074d, 0x07b1, + 0x07c0, 0x07fa, + 0x0800, 0x082d, + 0x0830, 0x083e, + 0x0900, 0x0939, + 0x093c, 0x094e, + 0x0950, 0x0955, + 0x0958, 0x0972, + 0x0979, 0x097f, + 0x0981, 0x0983, + 0x0985, 0x098c, + 0x098f, 0x0990, + 0x0993, 0x09a8, + 0x09aa, 0x09b0, + 0x09b2, 0x09b2, + 0x09b6, 0x09b9, + 0x09bc, 0x09c4, + 0x09c7, 0x09c8, + 0x09cb, 0x09ce, + 0x09d7, 0x09d7, + 0x09dc, 0x09dd, + 0x09df, 0x09e3, + 0x09e6, 0x09fb, + 0x0a01, 0x0a03, + 0x0a05, 0x0a0a, + 0x0a0f, 0x0a10, + 0x0a13, 0x0a28, + 0x0a2a, 0x0a30, + 0x0a32, 0x0a33, + 0x0a35, 0x0a36, + 0x0a38, 0x0a39, + 0x0a3c, 0x0a3c, + 0x0a3e, 0x0a42, + 0x0a47, 0x0a48, + 0x0a4b, 0x0a4d, + 0x0a51, 0x0a51, + 0x0a59, 0x0a5c, + 0x0a5e, 0x0a5e, + 0x0a66, 0x0a75, + 0x0a81, 0x0a83, + 0x0a85, 0x0a8d, + 0x0a8f, 0x0a91, + 0x0a93, 0x0aa8, + 0x0aaa, 0x0ab0, + 0x0ab2, 0x0ab3, + 0x0ab5, 0x0ab9, + 0x0abc, 0x0ac5, + 0x0ac7, 0x0ac9, + 0x0acb, 0x0acd, + 0x0ad0, 0x0ad0, + 0x0ae0, 0x0ae3, + 0x0ae6, 0x0aef, + 0x0af1, 0x0af1, + 0x0b01, 0x0b03, + 0x0b05, 0x0b0c, + 0x0b0f, 0x0b10, + 0x0b13, 0x0b28, + 0x0b2a, 0x0b30, + 0x0b32, 0x0b33, + 0x0b35, 0x0b39, + 0x0b3c, 0x0b44, + 0x0b47, 0x0b48, + 0x0b4b, 0x0b4d, + 0x0b56, 0x0b57, + 0x0b5c, 0x0b5d, + 0x0b5f, 0x0b63, + 0x0b66, 0x0b71, + 0x0b82, 0x0b83, + 0x0b85, 0x0b8a, + 0x0b8e, 0x0b90, + 0x0b92, 0x0b95, + 0x0b99, 0x0b9a, + 0x0b9c, 0x0b9c, + 0x0b9e, 0x0b9f, + 0x0ba3, 0x0ba4, + 0x0ba8, 0x0baa, + 0x0bae, 0x0bb9, + 0x0bbe, 0x0bc2, + 0x0bc6, 0x0bc8, + 0x0bca, 0x0bcd, + 0x0bd0, 0x0bd0, + 0x0bd7, 0x0bd7, + 0x0be6, 0x0bfa, + 0x0c01, 0x0c03, + 0x0c05, 0x0c0c, + 0x0c0e, 0x0c10, + 0x0c12, 0x0c28, + 0x0c2a, 0x0c33, + 0x0c35, 0x0c39, + 0x0c3d, 0x0c44, + 0x0c46, 0x0c48, + 0x0c4a, 0x0c4d, + 0x0c55, 0x0c56, + 0x0c58, 0x0c59, + 0x0c60, 0x0c63, + 0x0c66, 0x0c6f, + 0x0c78, 0x0c7f, + 0x0c82, 0x0c83, + 0x0c85, 0x0c8c, + 0x0c8e, 0x0c90, + 0x0c92, 0x0ca8, + 0x0caa, 0x0cb3, + 0x0cb5, 0x0cb9, + 0x0cbc, 0x0cc4, + 0x0cc6, 0x0cc8, + 0x0cca, 0x0ccd, + 0x0cd5, 0x0cd6, + 0x0cde, 0x0cde, + 0x0ce0, 0x0ce3, + 0x0ce6, 0x0cef, + 0x0cf1, 0x0cf2, + 0x0d02, 0x0d03, + 0x0d05, 0x0d0c, + 0x0d0e, 0x0d10, + 0x0d12, 0x0d28, + 0x0d2a, 0x0d39, + 0x0d3d, 0x0d44, + 0x0d46, 0x0d48, + 0x0d4a, 0x0d4d, + 0x0d57, 0x0d57, + 0x0d60, 0x0d63, + 0x0d66, 0x0d75, + 0x0d79, 0x0d7f, + 0x0d82, 0x0d83, + 0x0d85, 0x0d96, + 0x0d9a, 0x0db1, + 0x0db3, 0x0dbb, + 0x0dbd, 0x0dbd, + 0x0dc0, 0x0dc6, + 0x0dca, 0x0dca, + 0x0dcf, 0x0dd4, + 0x0dd6, 0x0dd6, + 0x0dd8, 0x0ddf, + 0x0df2, 0x0df4, + 0x0e01, 0x0e3a, + 0x0e3f, 0x0e5b, + 0x0e81, 0x0e82, + 0x0e84, 0x0e84, + 0x0e87, 0x0e88, + 0x0e8a, 0x0e8a, + 0x0e8d, 0x0e8d, + 0x0e94, 0x0e97, + 0x0e99, 0x0e9f, + 0x0ea1, 0x0ea3, + 0x0ea5, 0x0ea5, + 0x0ea7, 0x0ea7, + 0x0eaa, 0x0eab, + 0x0ead, 0x0eb9, + 0x0ebb, 0x0ebd, + 0x0ec0, 0x0ec4, + 0x0ec6, 0x0ec6, + 0x0ec8, 0x0ecd, + 0x0ed0, 0x0ed9, + 0x0edc, 0x0edd, + 0x0f00, 0x0f47, + 0x0f49, 0x0f6c, + 0x0f71, 0x0f8b, + 0x0f90, 0x0f97, + 0x0f99, 0x0fbc, + 0x0fbe, 0x0fcc, + 0x0fce, 0x0fd8, + 0x1000, 0x10c5, + 0x10d0, 0x10fc, + 0x1100, 0x1248, + 0x124a, 0x124d, + 0x1250, 0x1256, + 0x1258, 0x1258, + 0x125a, 0x125d, + 0x1260, 0x1288, + 0x128a, 0x128d, + 0x1290, 0x12b0, + 0x12b2, 0x12b5, + 0x12b8, 0x12be, + 0x12c0, 0x12c0, + 0x12c2, 0x12c5, + 0x12c8, 0x12d6, + 0x12d8, 0x1310, + 0x1312, 0x1315, + 0x1318, 0x135a, + 0x135f, 0x137c, + 0x1380, 0x1399, + 0x13a0, 0x13f4, + 0x1400, 0x167f, + 0x1681, 0x169c, + 0x16a0, 0x16f0, + 0x1700, 0x170c, + 0x170e, 0x1714, + 0x1720, 0x1736, + 0x1740, 0x1753, + 0x1760, 0x176c, + 0x176e, 0x1770, + 0x1772, 0x1773, + 0x1780, 0x17dd, + 0x17e0, 0x17e9, + 0x17f0, 0x17f9, + 0x1800, 0x180d, + 0x1810, 0x1819, + 0x1820, 0x1877, + 0x1880, 0x18aa, + 0x18b0, 0x18f5, + 0x1900, 0x191c, + 0x1920, 0x192b, + 0x1930, 0x193b, + 0x1940, 0x1940, + 0x1944, 0x196d, + 0x1970, 0x1974, + 0x1980, 0x19ab, + 0x19b0, 0x19c9, + 0x19d0, 0x19da, + 0x19de, 0x1a1b, + 0x1a1e, 0x1a5e, + 0x1a60, 0x1a7c, + 0x1a7f, 0x1a89, + 0x1a90, 0x1a99, + 0x1aa0, 0x1aad, + 0x1b00, 0x1b4b, + 0x1b50, 0x1b7c, + 0x1b80, 0x1baa, + 0x1bae, 0x1bb9, + 0x1c00, 0x1c37, + 0x1c3b, 0x1c49, + 0x1c4d, 0x1c7f, + 0x1cd0, 0x1cf2, + 0x1d00, 0x1de6, + 0x1dfd, 0x1f15, + 0x1f18, 0x1f1d, + 0x1f20, 0x1f45, + 0x1f48, 0x1f4d, + 0x1f50, 0x1f57, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f7d, + 0x1f80, 0x1fb4, + 0x1fb6, 0x1fc4, + 0x1fc6, 0x1fd3, + 0x1fd6, 0x1fdb, + 0x1fdd, 0x1fef, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ffe, + 0x200b, 0x2027, + 0x202a, 0x202e, + 0x2030, 0x205e, + 0x2060, 0x2064, + 0x206a, 0x2071, + 0x2074, 0x208e, + 0x2090, 0x2094, + 0x20a0, 0x20b8, + 0x20d0, 0x20f0, + 0x2100, 0x2189, + 0x2190, 0x23e8, + 0x2400, 0x2426, + 0x2440, 0x244a, + 0x2460, 0x26cd, + 0x26cf, 0x26e1, + 0x26e3, 0x26e3, + 0x26e8, 0x26ff, + 0x2701, 0x2704, + 0x2706, 0x2709, + 0x270c, 0x2727, + 0x2729, 0x274b, + 0x274d, 0x274d, + 0x274f, 0x2752, + 0x2756, 0x275e, + 0x2761, 0x2794, + 0x2798, 0x27af, + 0x27b1, 0x27be, + 0x27c0, 0x27ca, + 0x27cc, 0x27cc, + 0x27d0, 0x2b4c, + 0x2b50, 0x2b59, + 0x2c00, 0x2c2e, + 0x2c30, 0x2c5e, + 0x2c60, 0x2cf1, + 0x2cf9, 0x2d25, + 0x2d30, 0x2d65, + 0x2d6f, 0x2d6f, + 0x2d80, 0x2d96, + 0x2da0, 0x2da6, + 0x2da8, 0x2dae, + 0x2db0, 0x2db6, + 0x2db8, 0x2dbe, + 0x2dc0, 0x2dc6, + 0x2dc8, 0x2dce, + 0x2dd0, 0x2dd6, + 0x2dd8, 0x2dde, + 0x2de0, 0x2e31, + 0x2e80, 0x2e99, + 0x2e9b, 0x2ef3, + 0x2f00, 0x2fd5, + 0x2ff0, 0x2ffb, + 0x3001, 0x303f, + 0x3041, 0x3096, + 0x3099, 0x30ff, + 0x3105, 0x312d, + 0x3131, 0x318e, + 0x3190, 0x31b7, + 0x31c0, 0x31e3, + 0x31f0, 0x321e, + 0x3220, 0x32fe, + 0x3300, 0x4db5, + 0x4dc0, 0x9fcb, + 0xa000, 0xa48c, + 0xa490, 0xa4c6, + 0xa4d0, 0xa62b, + 0xa640, 0xa65f, + 0xa662, 0xa673, + 0xa67c, 0xa697, + 0xa6a0, 0xa6f7, + 0xa700, 0xa78c, + 0xa7fb, 0xa82b, + 0xa830, 0xa839, + 0xa840, 0xa877, + 0xa880, 0xa8c4, + 0xa8ce, 0xa8d9, + 0xa8e0, 0xa8fb, + 0xa900, 0xa953, + 0xa95f, 0xa97c, + 0xa980, 0xa9cd, + 0xa9cf, 0xa9d9, + 0xa9de, 0xa9df, + 0xaa00, 0xaa36, + 0xaa40, 0xaa4d, + 0xaa50, 0xaa59, + 0xaa5c, 0xaa7b, + 0xaa80, 0xaac2, + 0xaadb, 0xaadf, + 0xabc0, 0xabed, + 0xabf0, 0xabf9, + 0xac00, 0xd7a3, + 0xd7b0, 0xd7c6, + 0xd7cb, 0xd7fb, + 0xe000, 0xfa2d, + 0xfa30, 0xfa6d, + 0xfa70, 0xfad9, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xfb1d, 0xfb36, + 0xfb38, 0xfb3c, + 0xfb3e, 0xfb3e, + 0xfb40, 0xfb41, + 0xfb43, 0xfb44, + 0xfb46, 0xfbb1, + 0xfbd3, 0xfd3f, + 0xfd50, 0xfd8f, + 0xfd92, 0xfdc7, + 0xfdf0, 0xfdfd, + 0xfe00, 0xfe19, + 0xfe20, 0xfe26, + 0xfe30, 0xfe52, + 0xfe54, 0xfe66, + 0xfe68, 0xfe6b, + 0xfe70, 0xfe74, + 0xfe76, 0xfefc, + 0xfeff, 0xfeff, + 0xff01, 0xffbe, + 0xffc2, 0xffc7, + 0xffca, 0xffcf, + 0xffd2, 0xffd7, + 0xffda, 0xffdc, + 0xffe0, 0xffe6, + 0xffe8, 0xffee, + 0xfff9, 0xfffd, + 0x10000, 0x1000b, + 0x1000d, 0x10026, + 0x10028, 0x1003a, + 0x1003c, 0x1003d, + 0x1003f, 0x1004d, + 0x10050, 0x1005d, + 0x10080, 0x100fa, + 0x10100, 0x10102, + 0x10107, 0x10133, + 0x10137, 0x1018a, + 0x10190, 0x1019b, + 0x101d0, 0x101fd, + 0x10280, 0x1029c, + 0x102a0, 0x102d0, + 0x10300, 0x1031e, + 0x10320, 0x10323, + 0x10330, 0x1034a, + 0x10380, 0x1039d, + 0x1039f, 0x103c3, + 0x103c8, 0x103d5, + 0x10400, 0x1049d, + 0x104a0, 0x104a9, + 0x10800, 0x10805, + 0x10808, 0x10808, + 0x1080a, 0x10835, + 0x10837, 0x10838, + 0x1083c, 0x1083c, + 0x1083f, 0x10855, + 0x10857, 0x1085f, + 0x10900, 0x1091b, + 0x1091f, 0x10939, + 0x1093f, 0x1093f, + 0x10a00, 0x10a03, + 0x10a05, 0x10a06, + 0x10a0c, 0x10a13, + 0x10a15, 0x10a17, + 0x10a19, 0x10a33, + 0x10a38, 0x10a3a, + 0x10a3f, 0x10a47, + 0x10a50, 0x10a58, + 0x10a60, 0x10a7f, + 0x10b00, 0x10b35, + 0x10b39, 0x10b55, + 0x10b58, 0x10b72, + 0x10b78, 0x10b7f, + 0x10c00, 0x10c48, + 0x10e60, 0x10e7e, + 0x11080, 0x110c1, + 0x12000, 0x1236e, + 0x12400, 0x12462, + 0x12470, 0x12473, + 0x13000, 0x1342e, + 0x1d000, 0x1d0f5, + 0x1d100, 0x1d126, + 0x1d129, 0x1d1dd, + 0x1d200, 0x1d245, + 0x1d300, 0x1d356, + 0x1d360, 0x1d371, + 0x1d400, 0x1d454, + 0x1d456, 0x1d49c, + 0x1d49e, 0x1d49f, + 0x1d4a2, 0x1d4a2, + 0x1d4a5, 0x1d4a6, + 0x1d4a9, 0x1d4ac, + 0x1d4ae, 0x1d4b9, + 0x1d4bb, 0x1d4bb, + 0x1d4bd, 0x1d4c3, + 0x1d4c5, 0x1d505, + 0x1d507, 0x1d50a, + 0x1d50d, 0x1d514, + 0x1d516, 0x1d51c, + 0x1d51e, 0x1d539, + 0x1d53b, 0x1d53e, + 0x1d540, 0x1d544, + 0x1d546, 0x1d546, + 0x1d54a, 0x1d550, + 0x1d552, 0x1d6a5, + 0x1d6a8, 0x1d7cb, + 0x1d7ce, 0x1d7ff, + 0x1f000, 0x1f02b, + 0x1f030, 0x1f093, + 0x1f100, 0x1f10a, + 0x1f110, 0x1f12e, + 0x1f131, 0x1f131, + 0x1f13d, 0x1f13d, + 0x1f13f, 0x1f13f, + 0x1f142, 0x1f142, + 0x1f146, 0x1f146, + 0x1f14a, 0x1f14e, + 0x1f157, 0x1f157, + 0x1f15f, 0x1f15f, + 0x1f179, 0x1f179, + 0x1f17b, 0x1f17c, + 0x1f17f, 0x1f17f, + 0x1f18a, 0x1f18d, + 0x1f190, 0x1f190, + 0x1f200, 0x1f200, + 0x1f210, 0x1f231, + 0x1f240, 0x1f248, + 0x20000, 0x2a6d6, + 0x2a700, 0x2b734, + 0x2f800, 0x2fa1d, + 0xe0001, 0xe0001, + 0xe0020, 0xe007f, + 0xe0100, 0xe01ef, + 0xf0000, 0xffffd, + 0x100000, 0x10fffd, +}; /* CR_Graph */ + +/* 'Lower': [[:Lower:]] */ +#define CR_Lower CR_Lowercase + +/* 'Print': [[:Print:]] */ +static const OnigCodePoint CR_Print[] = { + 487, + 0x0020, 0x007e, + 0x00a0, 0x0377, + 0x037a, 0x037e, + 0x0384, 0x038a, + 0x038c, 0x038c, + 0x038e, 0x03a1, + 0x03a3, 0x0525, + 0x0531, 0x0556, + 0x0559, 0x055f, + 0x0561, 0x0587, + 0x0589, 0x058a, + 0x0591, 0x05c7, + 0x05d0, 0x05ea, + 0x05f0, 0x05f4, + 0x0600, 0x0603, + 0x0606, 0x061b, + 0x061e, 0x061f, + 0x0621, 0x065e, + 0x0660, 0x070d, + 0x070f, 0x074a, + 0x074d, 0x07b1, + 0x07c0, 0x07fa, + 0x0800, 0x082d, + 0x0830, 0x083e, + 0x0900, 0x0939, + 0x093c, 0x094e, + 0x0950, 0x0955, + 0x0958, 0x0972, + 0x0979, 0x097f, + 0x0981, 0x0983, + 0x0985, 0x098c, + 0x098f, 0x0990, + 0x0993, 0x09a8, + 0x09aa, 0x09b0, + 0x09b2, 0x09b2, + 0x09b6, 0x09b9, + 0x09bc, 0x09c4, + 0x09c7, 0x09c8, + 0x09cb, 0x09ce, + 0x09d7, 0x09d7, + 0x09dc, 0x09dd, + 0x09df, 0x09e3, + 0x09e6, 0x09fb, + 0x0a01, 0x0a03, + 0x0a05, 0x0a0a, + 0x0a0f, 0x0a10, + 0x0a13, 0x0a28, + 0x0a2a, 0x0a30, + 0x0a32, 0x0a33, + 0x0a35, 0x0a36, + 0x0a38, 0x0a39, + 0x0a3c, 0x0a3c, + 0x0a3e, 0x0a42, + 0x0a47, 0x0a48, + 0x0a4b, 0x0a4d, + 0x0a51, 0x0a51, + 0x0a59, 0x0a5c, + 0x0a5e, 0x0a5e, + 0x0a66, 0x0a75, + 0x0a81, 0x0a83, + 0x0a85, 0x0a8d, + 0x0a8f, 0x0a91, + 0x0a93, 0x0aa8, + 0x0aaa, 0x0ab0, + 0x0ab2, 0x0ab3, + 0x0ab5, 0x0ab9, + 0x0abc, 0x0ac5, + 0x0ac7, 0x0ac9, + 0x0acb, 0x0acd, + 0x0ad0, 0x0ad0, + 0x0ae0, 0x0ae3, + 0x0ae6, 0x0aef, + 0x0af1, 0x0af1, + 0x0b01, 0x0b03, + 0x0b05, 0x0b0c, + 0x0b0f, 0x0b10, + 0x0b13, 0x0b28, + 0x0b2a, 0x0b30, + 0x0b32, 0x0b33, + 0x0b35, 0x0b39, + 0x0b3c, 0x0b44, + 0x0b47, 0x0b48, + 0x0b4b, 0x0b4d, + 0x0b56, 0x0b57, + 0x0b5c, 0x0b5d, + 0x0b5f, 0x0b63, + 0x0b66, 0x0b71, + 0x0b82, 0x0b83, + 0x0b85, 0x0b8a, + 0x0b8e, 0x0b90, + 0x0b92, 0x0b95, + 0x0b99, 0x0b9a, + 0x0b9c, 0x0b9c, + 0x0b9e, 0x0b9f, + 0x0ba3, 0x0ba4, + 0x0ba8, 0x0baa, + 0x0bae, 0x0bb9, + 0x0bbe, 0x0bc2, + 0x0bc6, 0x0bc8, + 0x0bca, 0x0bcd, + 0x0bd0, 0x0bd0, + 0x0bd7, 0x0bd7, + 0x0be6, 0x0bfa, + 0x0c01, 0x0c03, + 0x0c05, 0x0c0c, + 0x0c0e, 0x0c10, + 0x0c12, 0x0c28, + 0x0c2a, 0x0c33, + 0x0c35, 0x0c39, + 0x0c3d, 0x0c44, + 0x0c46, 0x0c48, + 0x0c4a, 0x0c4d, + 0x0c55, 0x0c56, + 0x0c58, 0x0c59, + 0x0c60, 0x0c63, + 0x0c66, 0x0c6f, + 0x0c78, 0x0c7f, + 0x0c82, 0x0c83, + 0x0c85, 0x0c8c, + 0x0c8e, 0x0c90, + 0x0c92, 0x0ca8, + 0x0caa, 0x0cb3, + 0x0cb5, 0x0cb9, + 0x0cbc, 0x0cc4, + 0x0cc6, 0x0cc8, + 0x0cca, 0x0ccd, + 0x0cd5, 0x0cd6, + 0x0cde, 0x0cde, + 0x0ce0, 0x0ce3, + 0x0ce6, 0x0cef, + 0x0cf1, 0x0cf2, + 0x0d02, 0x0d03, + 0x0d05, 0x0d0c, + 0x0d0e, 0x0d10, + 0x0d12, 0x0d28, + 0x0d2a, 0x0d39, + 0x0d3d, 0x0d44, + 0x0d46, 0x0d48, + 0x0d4a, 0x0d4d, + 0x0d57, 0x0d57, + 0x0d60, 0x0d63, + 0x0d66, 0x0d75, + 0x0d79, 0x0d7f, + 0x0d82, 0x0d83, + 0x0d85, 0x0d96, + 0x0d9a, 0x0db1, + 0x0db3, 0x0dbb, + 0x0dbd, 0x0dbd, + 0x0dc0, 0x0dc6, + 0x0dca, 0x0dca, + 0x0dcf, 0x0dd4, + 0x0dd6, 0x0dd6, + 0x0dd8, 0x0ddf, + 0x0df2, 0x0df4, + 0x0e01, 0x0e3a, + 0x0e3f, 0x0e5b, + 0x0e81, 0x0e82, + 0x0e84, 0x0e84, + 0x0e87, 0x0e88, + 0x0e8a, 0x0e8a, + 0x0e8d, 0x0e8d, + 0x0e94, 0x0e97, + 0x0e99, 0x0e9f, + 0x0ea1, 0x0ea3, + 0x0ea5, 0x0ea5, + 0x0ea7, 0x0ea7, + 0x0eaa, 0x0eab, + 0x0ead, 0x0eb9, + 0x0ebb, 0x0ebd, + 0x0ec0, 0x0ec4, + 0x0ec6, 0x0ec6, + 0x0ec8, 0x0ecd, + 0x0ed0, 0x0ed9, + 0x0edc, 0x0edd, + 0x0f00, 0x0f47, + 0x0f49, 0x0f6c, + 0x0f71, 0x0f8b, + 0x0f90, 0x0f97, + 0x0f99, 0x0fbc, + 0x0fbe, 0x0fcc, + 0x0fce, 0x0fd8, + 0x1000, 0x10c5, + 0x10d0, 0x10fc, + 0x1100, 0x1248, + 0x124a, 0x124d, + 0x1250, 0x1256, + 0x1258, 0x1258, + 0x125a, 0x125d, + 0x1260, 0x1288, + 0x128a, 0x128d, + 0x1290, 0x12b0, + 0x12b2, 0x12b5, + 0x12b8, 0x12be, + 0x12c0, 0x12c0, + 0x12c2, 0x12c5, + 0x12c8, 0x12d6, + 0x12d8, 0x1310, + 0x1312, 0x1315, + 0x1318, 0x135a, + 0x135f, 0x137c, + 0x1380, 0x1399, + 0x13a0, 0x13f4, + 0x1400, 0x169c, + 0x16a0, 0x16f0, + 0x1700, 0x170c, + 0x170e, 0x1714, + 0x1720, 0x1736, + 0x1740, 0x1753, + 0x1760, 0x176c, + 0x176e, 0x1770, + 0x1772, 0x1773, + 0x1780, 0x17dd, + 0x17e0, 0x17e9, + 0x17f0, 0x17f9, + 0x1800, 0x180e, + 0x1810, 0x1819, + 0x1820, 0x1877, + 0x1880, 0x18aa, + 0x18b0, 0x18f5, + 0x1900, 0x191c, + 0x1920, 0x192b, + 0x1930, 0x193b, + 0x1940, 0x1940, + 0x1944, 0x196d, + 0x1970, 0x1974, + 0x1980, 0x19ab, + 0x19b0, 0x19c9, + 0x19d0, 0x19da, + 0x19de, 0x1a1b, + 0x1a1e, 0x1a5e, + 0x1a60, 0x1a7c, + 0x1a7f, 0x1a89, + 0x1a90, 0x1a99, + 0x1aa0, 0x1aad, + 0x1b00, 0x1b4b, + 0x1b50, 0x1b7c, + 0x1b80, 0x1baa, + 0x1bae, 0x1bb9, + 0x1c00, 0x1c37, + 0x1c3b, 0x1c49, + 0x1c4d, 0x1c7f, + 0x1cd0, 0x1cf2, + 0x1d00, 0x1de6, + 0x1dfd, 0x1f15, + 0x1f18, 0x1f1d, + 0x1f20, 0x1f45, + 0x1f48, 0x1f4d, + 0x1f50, 0x1f57, + 0x1f59, 0x1f59, + 0x1f5b, 0x1f5b, + 0x1f5d, 0x1f5d, + 0x1f5f, 0x1f7d, + 0x1f80, 0x1fb4, + 0x1fb6, 0x1fc4, + 0x1fc6, 0x1fd3, + 0x1fd6, 0x1fdb, + 0x1fdd, 0x1fef, + 0x1ff2, 0x1ff4, + 0x1ff6, 0x1ffe, + 0x2000, 0x2027, + 0x202a, 0x2064, + 0x206a, 0x2071, + 0x2074, 0x208e, + 0x2090, 0x2094, + 0x20a0, 0x20b8, + 0x20d0, 0x20f0, + 0x2100, 0x2189, + 0x2190, 0x23e8, + 0x2400, 0x2426, + 0x2440, 0x244a, + 0x2460, 0x26cd, + 0x26cf, 0x26e1, + 0x26e3, 0x26e3, + 0x26e8, 0x26ff, + 0x2701, 0x2704, + 0x2706, 0x2709, + 0x270c, 0x2727, + 0x2729, 0x274b, + 0x274d, 0x274d, + 0x274f, 0x2752, + 0x2756, 0x275e, + 0x2761, 0x2794, + 0x2798, 0x27af, + 0x27b1, 0x27be, + 0x27c0, 0x27ca, + 0x27cc, 0x27cc, + 0x27d0, 0x2b4c, + 0x2b50, 0x2b59, + 0x2c00, 0x2c2e, + 0x2c30, 0x2c5e, + 0x2c60, 0x2cf1, + 0x2cf9, 0x2d25, + 0x2d30, 0x2d65, + 0x2d6f, 0x2d6f, + 0x2d80, 0x2d96, + 0x2da0, 0x2da6, + 0x2da8, 0x2dae, + 0x2db0, 0x2db6, + 0x2db8, 0x2dbe, + 0x2dc0, 0x2dc6, + 0x2dc8, 0x2dce, + 0x2dd0, 0x2dd6, + 0x2dd8, 0x2dde, + 0x2de0, 0x2e31, + 0x2e80, 0x2e99, + 0x2e9b, 0x2ef3, + 0x2f00, 0x2fd5, + 0x2ff0, 0x2ffb, + 0x3000, 0x303f, + 0x3041, 0x3096, + 0x3099, 0x30ff, + 0x3105, 0x312d, + 0x3131, 0x318e, + 0x3190, 0x31b7, + 0x31c0, 0x31e3, + 0x31f0, 0x321e, + 0x3220, 0x32fe, + 0x3300, 0x4db5, + 0x4dc0, 0x9fcb, + 0xa000, 0xa48c, + 0xa490, 0xa4c6, + 0xa4d0, 0xa62b, + 0xa640, 0xa65f, + 0xa662, 0xa673, + 0xa67c, 0xa697, + 0xa6a0, 0xa6f7, + 0xa700, 0xa78c, + 0xa7fb, 0xa82b, + 0xa830, 0xa839, + 0xa840, 0xa877, + 0xa880, 0xa8c4, + 0xa8ce, 0xa8d9, + 0xa8e0, 0xa8fb, + 0xa900, 0xa953, + 0xa95f, 0xa97c, + 0xa980, 0xa9cd, + 0xa9cf, 0xa9d9, + 0xa9de, 0xa9df, + 0xaa00, 0xaa36, + 0xaa40, 0xaa4d, + 0xaa50, 0xaa59, + 0xaa5c, 0xaa7b, + 0xaa80, 0xaac2, + 0xaadb, 0xaadf, + 0xabc0, 0xabed, + 0xabf0, 0xabf9, + 0xac00, 0xd7a3, + 0xd7b0, 0xd7c6, + 0xd7cb, 0xd7fb, + 0xe000, 0xfa2d, + 0xfa30, 0xfa6d, + 0xfa70, 0xfad9, + 0xfb00, 0xfb06, + 0xfb13, 0xfb17, + 0xfb1d, 0xfb36, + 0xfb38, 0xfb3c, + 0xfb3e, 0xfb3e, + 0xfb40, 0xfb41, + 0xfb43, 0xfb44, + 0xfb46, 0xfbb1, + 0xfbd3, 0xfd3f, + 0xfd50, 0xfd8f, + 0xfd92, 0xfdc7, + 0xfdf0, 0xfdfd, + 0xfe00, 0xfe19, + 0xfe20, 0xfe26, + 0xfe30, 0xfe52, + 0xfe54, 0xfe66, + 0xfe68, 0xfe6b, + 0xfe70, 0xfe74, + 0xfe76, 0xfefc, + 0xfeff, 0xfeff, + 0xff01, 0xffbe, + 0xffc2, 0xffc7, + 0xffca, 0xffcf, + 0xffd2, 0xffd7, + 0xffda, 0xffdc, + 0xffe0, 0xffe6, + 0xffe8, 0xffee, + 0xfff9, 0xfffd, + 0x10000, 0x1000b, + 0x1000d, 0x10026, + 0x10028, 0x1003a, + 0x1003c, 0x1003d, + 0x1003f, 0x1004d, + 0x10050, 0x1005d, + 0x10080, 0x100fa, + 0x10100, 0x10102, + 0x10107, 0x10133, + 0x10137, 0x1018a, + 0x10190, 0x1019b, + 0x101d0, 0x101fd, + 0x10280, 0x1029c, + 0x102a0, 0x102d0, + 0x10300, 0x1031e, + 0x10320, 0x10323, + 0x10330, 0x1034a, + 0x10380, 0x1039d, + 0x1039f, 0x103c3, + 0x103c8, 0x103d5, + 0x10400, 0x1049d, + 0x104a0, 0x104a9, + 0x10800, 0x10805, + 0x10808, 0x10808, + 0x1080a, 0x10835, + 0x10837, 0x10838, + 0x1083c, 0x1083c, + 0x1083f, 0x10855, + 0x10857, 0x1085f, + 0x10900, 0x1091b, + 0x1091f, 0x10939, + 0x1093f, 0x1093f, + 0x10a00, 0x10a03, + 0x10a05, 0x10a06, + 0x10a0c, 0x10a13, + 0x10a15, 0x10a17, + 0x10a19, 0x10a33, + 0x10a38, 0x10a3a, + 0x10a3f, 0x10a47, + 0x10a50, 0x10a58, + 0x10a60, 0x10a7f, + 0x10b00, 0x10b35, + 0x10b39, 0x10b55, + 0x10b58, 0x10b72, + 0x10b78, 0x10b7f, + 0x10c00, 0x10c48, + 0x10e60, 0x10e7e, + 0x11080, 0x110c1, + 0x12000, 0x1236e, + 0x12400, 0x12462, + 0x12470, 0x12473, + 0x13000, 0x1342e, + 0x1d000, 0x1d0f5, + 0x1d100, 0x1d126, + 0x1d129, 0x1d1dd, + 0x1d200, 0x1d245, + 0x1d300, 0x1d356, + 0x1d360, 0x1d371, + 0x1d400, 0x1d454, + 0x1d456, 0x1d49c, + 0x1d49e, 0x1d49f, + 0x1d4a2, 0x1d4a2, + 0x1d4a5, 0x1d4a6, + 0x1d4a9, 0x1d4ac, + 0x1d4ae, 0x1d4b9, + 0x1d4bb, 0x1d4bb, + 0x1d4bd, 0x1d4c3, + 0x1d4c5, 0x1d505, + 0x1d507, 0x1d50a, + 0x1d50d, 0x1d514, + 0x1d516, 0x1d51c, + 0x1d51e, 0x1d539, + 0x1d53b, 0x1d53e, + 0x1d540, 0x1d544, + 0x1d546, 0x1d546, + 0x1d54a, 0x1d550, + 0x1d552, 0x1d6a5, + 0x1d6a8, 0x1d7cb, + 0x1d7ce, 0x1d7ff, + 0x1f000, 0x1f02b, + 0x1f030, 0x1f093, + 0x1f100, 0x1f10a, + 0x1f110, 0x1f12e, + 0x1f131, 0x1f131, + 0x1f13d, 0x1f13d, + 0x1f13f, 0x1f13f, + 0x1f142, 0x1f142, + 0x1f146, 0x1f146, + 0x1f14a, 0x1f14e, + 0x1f157, 0x1f157, + 0x1f15f, 0x1f15f, + 0x1f179, 0x1f179, + 0x1f17b, 0x1f17c, + 0x1f17f, 0x1f17f, + 0x1f18a, 0x1f18d, + 0x1f190, 0x1f190, + 0x1f200, 0x1f200, + 0x1f210, 0x1f231, + 0x1f240, 0x1f248, + 0x20000, 0x2a6d6, + 0x2a700, 0x2b734, + 0x2f800, 0x2fa1d, + 0xe0001, 0xe0001, + 0xe0020, 0xe007f, + 0xe0100, 0xe01ef, + 0xf0000, 0xffffd, + 0x100000, 0x10fffd, +}; /* CR_Print */ + +/* 'Punct': [[:Punct:]] */ +#define CR_Punct CR_P + +/* 'Space': [[:Space:]] */ +#define CR_Space CR_White_Space + +/* 'Upper': [[:Upper:]] */ +#define CR_Upper CR_Uppercase + +/* 'XDigit': [[:XDigit:]] */ +#define CR_XDigit CR_ASCII_Hex_Digit + +/* 'Word': [[:Word:]] */ +static const OnigCodePoint CR_Word[] = { + 506, ... truncated to 1.0MB