@port-labs/jq-node-bindings 0.0.14 → 0.0.15-dev2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/binding.gyp +42 -20
- package/configure +1 -1
- package/deps/jq/.gitattributes +12 -0
- package/deps/jq/AUTHORS +149 -43
- package/deps/jq/COPYING +75 -1
- package/deps/jq/ChangeLog +2 -2
- package/deps/jq/Makefile.am +106 -65
- package/deps/jq/NEWS.md +391 -0
- package/deps/jq/README.md +54 -52
- package/deps/jq/SECURITY.md +7 -0
- package/deps/jq/compile-ios.sh +106 -102
- package/deps/jq/configure.ac +72 -59
- package/deps/jq/docs/Pipfile +14 -0
- package/deps/jq/docs/Pipfile.lock +415 -0
- package/deps/jq/docs/README.md +15 -14
- package/deps/jq/docs/build_manpage.py +251 -0
- package/deps/jq/docs/build_mantests.py +21 -0
- package/deps/jq/docs/build_website.py +95 -0
- package/deps/jq/docs/content/download/default.yml +249 -0
- package/deps/jq/docs/content/index.yml +83 -0
- package/deps/jq/docs/content/{3.manual/v1.6 → manual/dev}/manual.yml +992 -452
- package/deps/jq/docs/content/{3.manual → manual}/v1.3/manual.yml +105 -116
- package/deps/jq/docs/content/{3.manual → manual}/v1.4/manual.yml +122 -129
- package/deps/jq/docs/content/{3.manual → manual}/v1.5/manual.yml +313 -262
- package/deps/jq/docs/content/{3.manual → manual/v1.6}/manual.yml +407 -332
- package/deps/jq/docs/content/manual/v1.7/manual.yml +3697 -0
- package/deps/jq/docs/content/tutorial/default.yml +337 -0
- package/deps/jq/docs/manual_schema.yml +60 -0
- package/deps/jq/docs/public/css/style.css +99 -0
- package/deps/jq/docs/public/icon.png +0 -0
- package/deps/jq/docs/public/icon.svg +1 -0
- package/deps/jq/docs/public/jq.svg +1 -0
- package/deps/jq/docs/public/js/manual-search.js +31 -49
- package/deps/jq/docs/templates/default.html.j2 +31 -0
- package/deps/jq/docs/templates/index.html.j2 +58 -0
- package/deps/jq/docs/templates/manual.html.j2 +120 -0
- package/deps/jq/docs/templates/shared/_footer.html.j2 +14 -0
- package/deps/jq/docs/templates/shared/_head.html.j2 +23 -0
- package/deps/jq/docs/templates/shared/_navbar.html.j2 +40 -0
- package/deps/jq/docs/validate_manual_schema.py +19 -0
- package/deps/jq/jq.1.prebuilt +1102 -294
- package/deps/jq/jq.spec +2 -3
- package/deps/jq/libjq.pc.in +11 -0
- package/deps/jq/m4/ax_pthread.m4 +522 -0
- package/deps/jq/modules/oniguruma/.travis.yml +17 -0
- package/deps/jq/modules/oniguruma/CMakeLists.txt +206 -41
- package/deps/jq/modules/oniguruma/COPYING +23 -25
- package/deps/jq/modules/oniguruma/HISTORY +368 -23
- package/deps/jq/modules/oniguruma/Makefile.am +61 -7
- package/deps/jq/modules/oniguruma/README +34 -20
- package/deps/jq/modules/oniguruma/README.md +106 -33
- package/deps/jq/modules/oniguruma/README_japanese +183 -0
- package/deps/jq/modules/oniguruma/autogen.sh +9 -0
- package/deps/jq/modules/oniguruma/cmake/Config.cmake.in +4 -0
- package/deps/jq/modules/oniguruma/configure.ac +66 -55
- package/deps/jq/modules/oniguruma/doc/API +485 -42
- package/deps/jq/modules/oniguruma/doc/API.ja +732 -293
- package/deps/jq/modules/oniguruma/doc/CALLOUTS.API +397 -0
- package/deps/jq/modules/oniguruma/doc/CALLOUTS.API.ja +393 -0
- package/deps/jq/modules/oniguruma/doc/CALLOUTS.BUILTIN +95 -0
- package/deps/jq/modules/oniguruma/doc/CALLOUTS.BUILTIN.ja +93 -0
- package/deps/jq/modules/oniguruma/doc/FAQ +3 -3
- package/deps/jq/modules/oniguruma/doc/FAQ.ja +8 -8
- package/deps/jq/modules/oniguruma/doc/RE +223 -63
- package/deps/jq/modules/oniguruma/doc/RE.ja +420 -265
- package/deps/jq/modules/oniguruma/doc/SYNTAX.md +1091 -0
- package/deps/jq/modules/oniguruma/doc/UNICODE_PROPERTIES +840 -697
- package/deps/jq/modules/oniguruma/harnesses/ascii_compatible.dict +113 -0
- package/deps/jq/modules/oniguruma/harnesses/base.c +749 -0
- package/deps/jq/modules/oniguruma/harnesses/deluxe.c +206 -0
- package/deps/jq/modules/oniguruma/harnesses/dict_conv.py +72 -0
- package/deps/jq/modules/oniguruma/harnesses/fuzzer.options +2 -0
- package/deps/jq/modules/oniguruma/harnesses/libfuzzer-onig.cpp +45 -0
- package/deps/jq/modules/oniguruma/harnesses/regset.c +392 -0
- package/deps/jq/modules/oniguruma/index.html +16 -5
- package/deps/jq/modules/oniguruma/index_ja.html +16 -5
- package/deps/jq/modules/oniguruma/make_win.bat +5 -0
- package/deps/jq/modules/oniguruma/make_win32.bat +5 -3
- package/deps/jq/modules/oniguruma/make_win64.bat +5 -3
- package/deps/jq/modules/oniguruma/onig-config.cmake.in +80 -0
- package/deps/jq/modules/oniguruma/onig-config.in +1 -1
- package/deps/jq/modules/oniguruma/oniguruma.pc.cmake.in +1 -1
- package/deps/jq/modules/oniguruma/oniguruma.pc.in +0 -1
- package/deps/jq/modules/oniguruma/sample/CMakeLists.txt +9 -2
- package/deps/jq/modules/oniguruma/sample/Makefile.am +24 -5
- package/deps/jq/modules/oniguruma/sample/bug_fix.c +13 -51
- package/deps/jq/modules/oniguruma/sample/callback_each_match.c +168 -0
- package/deps/jq/modules/oniguruma/sample/callout.c +268 -0
- package/deps/jq/modules/oniguruma/sample/count.c +125 -0
- package/deps/jq/modules/oniguruma/sample/crnl.c +6 -4
- package/deps/jq/modules/oniguruma/sample/echo.c +136 -0
- package/deps/jq/modules/oniguruma/sample/encode.c +53 -146
- package/deps/jq/modules/oniguruma/sample/listcap.c +18 -10
- package/deps/jq/modules/oniguruma/sample/names.c +10 -6
- package/deps/jq/modules/oniguruma/sample/posix.c +13 -2
- package/deps/jq/modules/oniguruma/sample/regset.c +95 -0
- package/deps/jq/modules/oniguruma/sample/scan.c +20 -6
- package/deps/jq/modules/oniguruma/sample/simple.c +8 -4
- package/deps/jq/modules/oniguruma/sample/sql.c +13 -8
- package/deps/jq/modules/oniguruma/sample/syntax.c +11 -10
- package/deps/jq/modules/oniguruma/sample/user_property.c +12 -7
- package/deps/jq/modules/oniguruma/src/Makefile.am +41 -15
- package/deps/jq/modules/oniguruma/src/Makefile.windows +196 -183
- package/deps/jq/modules/oniguruma/src/ascii.c +64 -7
- package/deps/jq/modules/oniguruma/src/big5.c +25 -15
- package/deps/jq/modules/oniguruma/src/config.h.cmake.in +7 -22
- package/deps/jq/modules/oniguruma/src/config.h.win32 +56 -84
- package/deps/jq/modules/oniguruma/src/config.h.win64 +56 -84
- package/deps/jq/modules/oniguruma/src/config.h.windows.in +62 -0
- package/deps/jq/modules/oniguruma/src/cp1251.c +14 -8
- package/deps/jq/modules/oniguruma/src/euc_jp.c +28 -30
- package/deps/jq/modules/oniguruma/src/euc_jp_prop.c +25 -32
- package/deps/jq/modules/oniguruma/src/euc_jp_prop.gperf +1 -2
- package/deps/jq/modules/oniguruma/src/euc_kr.c +27 -15
- package/deps/jq/modules/oniguruma/src/euc_tw.c +40 -17
- package/deps/jq/modules/oniguruma/src/gb18030.c +177 -119
- package/deps/jq/modules/oniguruma/src/gperf_fold_key_conv.py +12 -8
- package/deps/jq/modules/oniguruma/src/gperf_unfold_key_conv.py +8 -6
- package/deps/jq/modules/oniguruma/src/iso8859_1.c +92 -91
- package/deps/jq/modules/oniguruma/src/iso8859_10.c +13 -29
- package/deps/jq/modules/oniguruma/src/iso8859_11.c +4 -2
- package/deps/jq/modules/oniguruma/src/iso8859_13.c +13 -33
- package/deps/jq/modules/oniguruma/src/iso8859_14.c +13 -30
- package/deps/jq/modules/oniguruma/src/iso8859_15.c +13 -34
- package/deps/jq/modules/oniguruma/src/iso8859_16.c +13 -29
- package/deps/jq/modules/oniguruma/src/iso8859_2.c +13 -29
- package/deps/jq/modules/oniguruma/src/iso8859_3.c +13 -33
- package/deps/jq/modules/oniguruma/src/iso8859_4.c +13 -32
- package/deps/jq/modules/oniguruma/src/iso8859_5.c +16 -23
- package/deps/jq/modules/oniguruma/src/iso8859_6.c +4 -2
- package/deps/jq/modules/oniguruma/src/iso8859_7.c +14 -29
- package/deps/jq/modules/oniguruma/src/iso8859_8.c +4 -2
- package/deps/jq/modules/oniguruma/src/iso8859_9.c +13 -33
- package/deps/jq/modules/oniguruma/src/koi8.c +14 -27
- package/deps/jq/modules/oniguruma/src/koi8_r.c +12 -19
- package/deps/jq/modules/oniguruma/src/make_property.sh +21 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_egcb.sh +7 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_egcb_data.py +267 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_fold.sh +25 -11
- package/deps/jq/modules/oniguruma/src/make_unicode_fold_data.py +206 -26
- package/deps/jq/modules/oniguruma/src/make_unicode_property.sh +19 -10
- package/deps/jq/modules/oniguruma/src/make_unicode_property_data.py +474 -375
- package/deps/jq/modules/oniguruma/src/make_unicode_wb.sh +7 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_wb_data.py +267 -0
- package/deps/jq/modules/oniguruma/src/mktable.c +28 -24
- package/deps/jq/modules/oniguruma/src/onig_init.c +2 -2
- package/deps/jq/modules/oniguruma/src/oniggnu.h +7 -5
- package/deps/jq/modules/oniguruma/src/onigposix.h +40 -16
- package/deps/jq/modules/oniguruma/src/oniguruma.h +357 -107
- package/deps/jq/modules/oniguruma/src/regcomp.c +6214 -3933
- package/deps/jq/modules/oniguruma/src/regenc.c +197 -120
- package/deps/jq/modules/oniguruma/src/regenc.h +106 -63
- package/deps/jq/modules/oniguruma/src/regerror.c +112 -91
- package/deps/jq/modules/oniguruma/src/regexec.c +4876 -2010
- package/deps/jq/modules/oniguruma/src/regext.c +8 -8
- package/deps/jq/modules/oniguruma/src/reggnu.c +13 -17
- package/deps/jq/modules/oniguruma/src/regint.h +757 -491
- package/deps/jq/modules/oniguruma/src/regparse.c +7204 -3240
- package/deps/jq/modules/oniguruma/src/regparse.h +361 -218
- package/deps/jq/modules/oniguruma/src/regposerr.c +49 -9
- package/deps/jq/modules/oniguruma/src/regposix.c +106 -24
- package/deps/jq/modules/oniguruma/src/regsyntax.c +66 -13
- package/deps/jq/modules/oniguruma/src/regtrav.c +1 -1
- package/deps/jq/modules/oniguruma/src/regversion.c +6 -4
- package/deps/jq/modules/oniguruma/src/sjis.c +23 -52
- package/deps/jq/modules/oniguruma/src/sjis_prop.c +25 -32
- package/deps/jq/modules/oniguruma/src/sjis_prop.gperf +1 -2
- package/deps/jq/modules/oniguruma/src/st.c +248 -249
- package/deps/jq/modules/oniguruma/src/st.h +4 -5
- package/deps/jq/modules/oniguruma/src/unicode.c +869 -294
- package/deps/jq/modules/oniguruma/src/unicode_egcb_data.c +1419 -0
- package/deps/jq/modules/oniguruma/src/unicode_fold1_key.c +1829 -1300
- package/deps/jq/modules/oniguruma/src/unicode_fold2_key.c +32 -9
- package/deps/jq/modules/oniguruma/src/unicode_fold3_key.c +32 -9
- package/deps/jq/modules/oniguruma/src/unicode_fold_data.c +1210 -984
- package/deps/jq/modules/oniguruma/src/unicode_property_data.c +22480 -15198
- package/deps/jq/modules/oniguruma/src/unicode_property_data_posix.c +1463 -591
- package/deps/jq/modules/oniguruma/src/unicode_unfold_key.c +1958 -1418
- package/deps/jq/modules/oniguruma/src/unicode_wb_data.c +1106 -0
- package/deps/jq/modules/oniguruma/src/utf16_be.c +90 -49
- package/deps/jq/modules/oniguruma/src/utf16_le.c +80 -49
- package/deps/jq/modules/oniguruma/src/utf32_be.c +14 -42
- package/deps/jq/modules/oniguruma/src/utf32_le.c +13 -40
- package/deps/jq/modules/oniguruma/src/utf8.c +33 -78
- package/deps/jq/modules/oniguruma/test/CMakeLists.txt +55 -0
- package/deps/jq/modules/oniguruma/test/Makefile.am +65 -10
- package/deps/jq/modules/oniguruma/test/test.sh +17 -0
- package/deps/jq/modules/oniguruma/test/test_back.c +1450 -0
- package/deps/jq/modules/oniguruma/test/test_options.c +228 -0
- package/deps/jq/modules/oniguruma/test/test_regset.c +466 -0
- package/deps/jq/modules/oniguruma/test/test_syntax.c +365 -0
- package/deps/jq/modules/oniguruma/test/test_utf8.c +1761 -0
- package/deps/jq/modules/oniguruma/test/testc.c +128 -88
- package/deps/jq/modules/oniguruma/test/testp.c +613 -0
- package/deps/jq/modules/oniguruma/test/testu.c +75 -28
- package/deps/jq/modules/oniguruma/tis-ci/stub.c +3 -0
- package/deps/jq/modules/oniguruma/tis-ci/test_back.config +26 -0
- package/deps/jq/modules/oniguruma/tis-ci/test_regset.config +20 -0
- package/deps/jq/modules/oniguruma/tis-ci/test_syntax.config +26 -0
- package/deps/jq/modules/oniguruma/tis-ci/test_utf8.config +25 -0
- package/deps/jq/modules/oniguruma/tis-ci/testc.config +26 -0
- package/deps/jq/modules/oniguruma/tis-ci/testu.config +24 -0
- package/deps/jq/modules/oniguruma/tis.config +1336 -0
- package/deps/jq/modules/oniguruma/windows/CMakeLists.txt +8 -0
- package/deps/jq/modules/oniguruma/windows/testc.c +865 -869
- package/deps/jq/scripts/update-website +6 -5
- package/deps/jq/scripts/version +10 -7
- package/deps/jq/sig/jq-release-new.key +29 -0
- package/deps/jq/sig/v1.4/sha256sum.txt +1 -0
- package/deps/jq/sig/v1.5/sha256sum.txt +2 -0
- package/deps/jq/sig/v1.5rc1/sha256sum.txt +1 -0
- package/deps/jq/sig/v1.5rc2/sha256sum.txt +2 -0
- package/deps/jq/sig/v1.6/sha256sum.txt +2 -0
- package/deps/jq/sig/v1.7/jq-1.7.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.7/jq-1.7.zip.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.7/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.7/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.7/sha256sum.txt +23 -0
- package/deps/jq/sig/v1.7.1/jq-1.7.1.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-1.7.1.zip.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-osx-amd64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-win64.exe.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.7.1/sha256sum.txt +26 -0
- package/deps/jq/sig/v1.7rc1/jq-1.7rc1.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-1.7rc1.zip.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.7rc1/sha256sum.txt +23 -0
- package/deps/jq/sig/v1.7rc2/jq-1.7rc2.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-1.7rc2.zip.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.7rc2/sha256sum.txt +23 -0
- package/deps/jq/src/builtin.c +537 -343
- package/deps/jq/src/builtin.h +18 -0
- package/deps/jq/src/builtin.jq +116 -143
- package/deps/jq/src/bytecode.h +8 -4
- package/deps/jq/src/compile.c +157 -143
- package/deps/jq/src/compile.h +3 -4
- package/deps/jq/src/decNumber/ICU-license.html +45 -0
- package/deps/jq/src/decNumber/decBasic.c +3908 -0
- package/deps/jq/src/decNumber/decCommon.c +1835 -0
- package/deps/jq/src/decNumber/decContext.c +437 -0
- package/deps/jq/src/decNumber/decContext.h +254 -0
- package/deps/jq/src/decNumber/decDPD.h +1185 -0
- package/deps/jq/src/decNumber/decDouble.c +140 -0
- package/deps/jq/src/decNumber/decDouble.h +155 -0
- package/deps/jq/src/decNumber/decNumber.c +8143 -0
- package/deps/jq/src/decNumber/decNumber.h +182 -0
- package/deps/jq/src/decNumber/decNumberLocal.h +757 -0
- package/deps/jq/src/decNumber/decPacked.c +220 -0
- package/deps/jq/src/decNumber/decPacked.h +52 -0
- package/deps/jq/src/decNumber/decQuad.c +135 -0
- package/deps/jq/src/decNumber/decQuad.h +177 -0
- package/deps/jq/src/decNumber/decSingle.c +71 -0
- package/deps/jq/src/decNumber/decSingle.h +86 -0
- package/deps/jq/src/decNumber/decimal128.c +553 -0
- package/deps/jq/src/decNumber/decimal128.h +81 -0
- package/deps/jq/src/decNumber/decimal32.c +476 -0
- package/deps/jq/src/decNumber/decimal32.h +81 -0
- package/deps/jq/src/decNumber/decimal64.c +839 -0
- package/deps/jq/src/decNumber/decimal64.h +83 -0
- package/deps/jq/src/decNumber/decnumber.pdf +0 -0
- package/deps/jq/src/decNumber/example1.c +38 -0
- package/deps/jq/src/decNumber/example2.c +52 -0
- package/deps/jq/src/decNumber/example3.c +64 -0
- package/deps/jq/src/decNumber/example4.c +61 -0
- package/deps/jq/src/decNumber/example5.c +36 -0
- package/deps/jq/src/decNumber/example6.c +61 -0
- package/deps/jq/src/decNumber/example7.c +35 -0
- package/deps/jq/src/decNumber/example8.c +39 -0
- package/deps/jq/src/decNumber/readme.txt +81 -0
- package/deps/jq/src/exec_stack.h +5 -3
- package/deps/jq/src/execute.c +126 -44
- package/deps/jq/src/inject_errors.c +0 -2
- package/deps/jq/src/jq.h +10 -1
- package/deps/jq/src/jq_test.c +222 -11
- package/deps/jq/src/jv.c +807 -176
- package/deps/jq/src/jv.h +22 -1
- package/deps/jq/src/jv_alloc.c +33 -26
- package/deps/jq/src/jv_alloc.h +0 -11
- package/deps/jq/src/jv_aux.c +153 -67
- package/deps/jq/src/jv_dtoa.c +12 -2
- package/deps/jq/src/jv_dtoa_tsd.c +51 -0
- package/deps/jq/src/jv_dtoa_tsd.h +4 -0
- package/deps/jq/src/jv_parse.c +70 -15
- package/deps/jq/src/jv_print.c +56 -60
- package/deps/jq/src/jv_private.h +7 -0
- package/deps/jq/src/jv_thread.h +76 -0
- package/deps/jq/src/jv_unicode.c +18 -0
- package/deps/jq/src/jv_unicode.h +2 -0
- package/deps/jq/src/lexer.c +782 -543
- package/deps/jq/src/lexer.h +438 -64
- package/deps/jq/src/lexer.l +10 -3
- package/deps/jq/src/libm.h +16 -6
- package/deps/jq/src/linker.c +97 -40
- package/deps/jq/src/locfile.c +2 -1
- package/deps/jq/src/main.c +384 -336
- package/deps/jq/src/opcode_list.h +5 -2
- package/deps/jq/src/parser.c +2260 -1898
- package/deps/jq/src/parser.h +115 -98
- package/deps/jq/src/parser.y +124 -89
- package/deps/jq/src/util.c +854 -55
- package/deps/jq/src/util.h +6 -4
- package/deps/jq/tests/jq.test +762 -26
- package/deps/jq/tests/jq_fuzz_compile.c +27 -0
- package/deps/jq/tests/jq_fuzz_execute.cpp +42 -0
- package/deps/jq/tests/jq_fuzz_fixed.cpp +297 -0
- package/deps/jq/tests/jq_fuzz_load_file.c +28 -0
- package/deps/jq/tests/jq_fuzz_parse.c +21 -0
- package/deps/jq/tests/jq_fuzz_parse_extended.c +36 -0
- package/deps/jq/tests/jq_fuzz_parse_stream.c +21 -0
- package/deps/jq/tests/local.supp +14 -0
- package/deps/jq/tests/man.test +979 -0
- package/deps/jq/tests/manonig.test +76 -0
- package/deps/jq/tests/manonigtest +5 -0
- package/deps/jq/tests/mantest +1 -2
- package/deps/jq/tests/modules/home2/.jq/g.jq +1 -0
- package/deps/jq/tests/modules/shadow1.jq +2 -0
- package/deps/jq/tests/modules/shadow2.jq +1 -0
- package/deps/jq/tests/modules/test_bind_order0.jq +1 -0
- package/deps/jq/tests/modules/test_bind_order1.jq +1 -1
- package/deps/jq/tests/modules/test_bind_order2.jq +0 -1
- package/deps/jq/tests/no-main-program.jq +1 -0
- package/deps/jq/tests/onig.test +77 -2
- package/deps/jq/tests/setup +7 -2
- package/deps/jq/tests/shtest +478 -59
- package/deps/jq/tests/uri.test +38 -0
- package/deps/jq/tests/uritest +5 -0
- package/deps/jq/tests/yes-main-program.jq +2 -0
- package/index.d.ts +2 -0
- package/lib/index.js +3 -0
- package/lib/jq.js +15 -1
- package/lib/templateAsync.js +137 -0
- package/package.json +3 -3
- package/src/binding.cc +623 -146
- package/src/binding.h +3 -4
- package/test/santiy-async.test.js +171 -0
- package/test/santiy.test.js +2 -2
- package/test/template-async.test.js +182 -0
- package/test/template.test.js +3 -3
- package/deps/jq/.travis.yml +0 -202
- package/deps/jq/NEWS +0 -89
- package/deps/jq/appveyor.yml +0 -53
- package/deps/jq/docs/Gemfile +0 -7
- package/deps/jq/docs/Gemfile.lock +0 -63
- package/deps/jq/docs/Rakefile +0 -24
- package/deps/jq/docs/Rakefile.manual +0 -49
- package/deps/jq/docs/Rakefile.website +0 -76
- package/deps/jq/docs/content/1.tutorial/default.yml +0 -327
- package/deps/jq/docs/content/2.download/default.yml +0 -193
- package/deps/jq/docs/content/index/index.yml +0 -73
- package/deps/jq/docs/public/css/base.scss +0 -181
- package/deps/jq/docs/public/jq.png +0 -0
- package/deps/jq/docs/site.yml +0 -9
- package/deps/jq/docs/templates/default.liquid +0 -34
- package/deps/jq/docs/templates/index.liquid +0 -73
- package/deps/jq/docs/templates/manual.liquid +0 -99
- package/deps/jq/docs/templates/shared/_footer.liquid +0 -10
- package/deps/jq/docs/templates/shared/_head.liquid +0 -17
- package/deps/jq/docs/templates/shared/_navbar.liquid +0 -27
- package/deps/jq/modules/oniguruma/README.ja +0 -195
- package/deps/jq/modules/oniguruma/cmake/dist.cmake +0 -321
- package/deps/jq/modules/oniguruma/contributed/libfuzzer-onig.cpp +0 -31
- package/deps/jq/modules/oniguruma/dist.info +0 -10
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold1_key.c +0 -2250
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold2_key.c +0 -203
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold3_key.c +0 -113
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold_data.c +0 -1225
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_property_data.c +0 -24742
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_property_data_posix.c +0 -4846
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_unfold_key.c +0 -2571
- /package/deps/jq/sig/{jq-release.key → jq-release-old.key} +0 -0
- /package/deps/jq/tests/modules/{.jq → home1/.jq} +0 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* test_options.c
|
|
3
|
+
* Copyright (c) 2020-2021 K.Kosako
|
|
4
|
+
*/
|
|
5
|
+
#ifdef ONIG_ESCAPE_UCHAR_COLLISION
|
|
6
|
+
#undef ONIG_ESCAPE_UCHAR_COLLISION
|
|
7
|
+
#endif
|
|
8
|
+
#include <stdio.h>
|
|
9
|
+
|
|
10
|
+
#include "oniguruma.h"
|
|
11
|
+
|
|
12
|
+
#include <string.h>
|
|
13
|
+
|
|
14
|
+
#define SLEN(s) strlen(s)
|
|
15
|
+
|
|
16
|
+
static int nsucc = 0;
|
|
17
|
+
static int nfail = 0;
|
|
18
|
+
static int nerror = 0;
|
|
19
|
+
|
|
20
|
+
#ifdef __TRUSTINSOFT_ANALYZER__
|
|
21
|
+
static int nall = 0;
|
|
22
|
+
#endif
|
|
23
|
+
|
|
24
|
+
static FILE* err_file;
|
|
25
|
+
|
|
26
|
+
static OnigRegion* region;
|
|
27
|
+
|
|
28
|
+
static void xx(OnigOptionType options, char* pattern, char* str,
|
|
29
|
+
int from, int to, int mem, int not, int error_no, int line_no)
|
|
30
|
+
{
|
|
31
|
+
#ifdef __TRUSTINSOFT_ANALYZER__
|
|
32
|
+
if (nall++ % TIS_TEST_CHOOSE_MAX != TIS_TEST_CHOOSE_CURRENT) return;
|
|
33
|
+
#endif
|
|
34
|
+
|
|
35
|
+
int r;
|
|
36
|
+
regex_t* reg;
|
|
37
|
+
OnigErrorInfo einfo;
|
|
38
|
+
|
|
39
|
+
r = onig_new(®, (UChar* )pattern, (UChar* )(pattern + SLEN(pattern)),
|
|
40
|
+
options, ONIG_ENCODING_UTF8, ONIG_SYNTAX_DEFAULT, &einfo);
|
|
41
|
+
if (r) {
|
|
42
|
+
char s[ONIG_MAX_ERROR_MESSAGE_LEN];
|
|
43
|
+
|
|
44
|
+
if (error_no == 0) {
|
|
45
|
+
onig_error_code_to_str((UChar* )s, r, &einfo);
|
|
46
|
+
fprintf(err_file, "ERROR: %s /%s/ #%d\n", s, pattern, line_no);
|
|
47
|
+
nerror++;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
if (r == error_no) {
|
|
51
|
+
fprintf(stdout, "OK(ERROR): /%s/ %d #%d\n", pattern, r, line_no);
|
|
52
|
+
nsucc++;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
fprintf(stdout, "FAIL(ERROR): /%s/ '%s', %d, %d #%d\n", pattern, str,
|
|
56
|
+
error_no, r, line_no);
|
|
57
|
+
nfail++;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return ;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
r = onig_search(reg, (UChar* )str, (UChar* )(str + SLEN(str)),
|
|
65
|
+
(UChar* )str, (UChar* )(str + SLEN(str)),
|
|
66
|
+
region, options);
|
|
67
|
+
if (r < ONIG_MISMATCH) {
|
|
68
|
+
char s[ONIG_MAX_ERROR_MESSAGE_LEN];
|
|
69
|
+
|
|
70
|
+
if (error_no == 0) {
|
|
71
|
+
onig_error_code_to_str((UChar* )s, r);
|
|
72
|
+
fprintf(err_file, "ERROR: %s /%s/ #%d\n", s, pattern, line_no);
|
|
73
|
+
nerror++;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
if (r == error_no) {
|
|
77
|
+
fprintf(stdout, "OK(ERROR): /%s/ '%s', %d #%d\n",
|
|
78
|
+
pattern, str, r, line_no);
|
|
79
|
+
nsucc++;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
fprintf(stdout, "FAIL ERROR NO: /%s/ '%s', %d, %d #%d\n",
|
|
83
|
+
pattern, str, error_no, r, line_no);
|
|
84
|
+
nfail++;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return ;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (r == ONIG_MISMATCH) {
|
|
92
|
+
if (not) {
|
|
93
|
+
fprintf(stdout, "OK(N): /%s/ '%s' #%d\n", pattern, str, line_no);
|
|
94
|
+
nsucc++;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
fprintf(stdout, "FAIL: /%s/ '%s' #%d\n", pattern, str, line_no);
|
|
98
|
+
nfail++;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
if (not) {
|
|
103
|
+
fprintf(stdout, "FAIL(N): /%s/ '%s' #%d\n", pattern, str, line_no);
|
|
104
|
+
nfail++;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
if (region->beg[mem] == from && region->end[mem] == to) {
|
|
108
|
+
fprintf(stdout, "OK: /%s/ '%s' #%d\n", pattern, str, line_no);
|
|
109
|
+
nsucc++;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d #%d\n", pattern, str,
|
|
113
|
+
from, to, region->beg[mem], region->end[mem], line_no);
|
|
114
|
+
nfail++;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
onig_free(reg);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
static void xx2(OnigOptionType options, char* pattern, char* str,
|
|
122
|
+
int from, int to, int line_no)
|
|
123
|
+
{
|
|
124
|
+
xx(options, pattern, str, from, to, 0, 0, 0, line_no);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
static void xx3(OnigOptionType options, char* pattern, char* str,
|
|
128
|
+
int from, int to, int mem, int line_no)
|
|
129
|
+
{
|
|
130
|
+
xx(options, pattern, str, from, to, mem, 0, 0, line_no);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
static void xn(OnigOptionType options, char* pattern, char* str, int line_no)
|
|
134
|
+
{
|
|
135
|
+
xx(options, pattern, str, 0, 0, 0, 1, 0, line_no);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
#if 0
|
|
139
|
+
static void xe(OnigOptionType options, char* pattern, char* str,
|
|
140
|
+
int error_no, int line_no)
|
|
141
|
+
{
|
|
142
|
+
xx(options, pattern, str, 0, 0, 0, 0, error_no, line_no);
|
|
143
|
+
}
|
|
144
|
+
#endif
|
|
145
|
+
|
|
146
|
+
#define x2(o,p,s,f,t) xx2(o,p,s,f,t, __LINE__)
|
|
147
|
+
#define x3(o,p,s,f,t,m) xx3(o,p,s,f,t,m, __LINE__)
|
|
148
|
+
#define n(o,p,s) xn(o,p,s, __LINE__)
|
|
149
|
+
#define e(o,p,s,en) xe(o,p,s,en, __LINE__)
|
|
150
|
+
|
|
151
|
+
#define OIA (ONIG_OPTION_IGNORECASE | ONIG_OPTION_IGNORECASE_IS_ASCII)
|
|
152
|
+
|
|
153
|
+
extern int main(int argc, char* argv[])
|
|
154
|
+
{
|
|
155
|
+
OnigEncoding use_encs[1];
|
|
156
|
+
|
|
157
|
+
use_encs[0] = ONIG_ENCODING_UTF8;
|
|
158
|
+
onig_initialize(use_encs, sizeof(use_encs)/sizeof(use_encs[0]));
|
|
159
|
+
|
|
160
|
+
err_file = stdout;
|
|
161
|
+
|
|
162
|
+
region = onig_region_new();
|
|
163
|
+
|
|
164
|
+
x2(ONIG_OPTION_IGNORECASE, "a", "A", 0, 1);
|
|
165
|
+
n(ONIG_OPTION_IGNORECASE_IS_ASCII, "a", "A");
|
|
166
|
+
/* KELVIN SIGN */
|
|
167
|
+
x2(ONIG_OPTION_IGNORECASE, "\xe2\x84\xaa", "k", 0, 1);
|
|
168
|
+
x2(ONIG_OPTION_IGNORECASE, "k", "\xe2\x84\xaa", 0, 3);
|
|
169
|
+
n(OIA, "\xe2\x84\xaa", "k");
|
|
170
|
+
n(OIA, "k", "\xe2\x84\xaa");
|
|
171
|
+
x2(OIA, "a", "a", 0, 1);
|
|
172
|
+
x2(OIA, "A", "A", 0, 1);
|
|
173
|
+
x2(OIA, "a", "A", 0, 1);
|
|
174
|
+
x2(OIA, "A", "a", 0, 1);
|
|
175
|
+
x2(OIA, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz", 0, 26);
|
|
176
|
+
x2(OIA, "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, 26);
|
|
177
|
+
x2(OIA, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "ABCabcdefghijklmnopqrstuvwxyz", 3, 29);
|
|
178
|
+
x2(OIA, "abcdefghijklmnopqrstuvwxyz", "abcABCDEFGHIJKLMNOPQRSTUVWXYZ", 3, 29);
|
|
179
|
+
x3(OIA, "#%(a!;)(b&)", "#%A!;B&", 5, 7, 2);
|
|
180
|
+
|
|
181
|
+
x2(ONIG_OPTION_IGNORECASE, "ss", "\xc3\x9f", 0, 2);
|
|
182
|
+
x2(ONIG_OPTION_IGNORECASE, "\xc3\x9f", "SS", 0, 2);
|
|
183
|
+
n(OIA, "ss", "\xc3\x9f");
|
|
184
|
+
n(OIA, "\xc3\x9f", "ss");
|
|
185
|
+
x2(OIA, "ss", "SS", 0, 2);
|
|
186
|
+
x2(OIA, "Ss", "sS", 0, 2);
|
|
187
|
+
|
|
188
|
+
n(ONIG_OPTION_NOTBOL, "^ab", "ab");
|
|
189
|
+
n(ONIG_OPTION_NOTBOL, "\\Aab", "ab");
|
|
190
|
+
n(ONIG_OPTION_NOTEOL, "ab$", "ab");
|
|
191
|
+
n(ONIG_OPTION_NOTEOL, "ab\\z", "ab");
|
|
192
|
+
n(ONIG_OPTION_NOTEOL, "ab\\Z", "ab");
|
|
193
|
+
n(ONIG_OPTION_NOTEOL, "ab\\Z", "ab\n");
|
|
194
|
+
|
|
195
|
+
n(ONIG_OPTION_NOT_BEGIN_STRING, "\\Aab", "ab");
|
|
196
|
+
n(ONIG_OPTION_NOT_END_STRING, "ab\\z", "ab");
|
|
197
|
+
n(ONIG_OPTION_NOT_END_STRING, "ab\\Z", "ab");
|
|
198
|
+
n(ONIG_OPTION_NOT_END_STRING, "ab\\Z", "ab\n");
|
|
199
|
+
|
|
200
|
+
x2(ONIG_OPTION_NONE, "a|abc", "abc", 0, 1);
|
|
201
|
+
x2(ONIG_OPTION_NONE, "(a|abc)\\Z", "abc", 0, 3);
|
|
202
|
+
x2(ONIG_OPTION_MATCH_WHOLE_STRING, "a|abc", "abc", 0, 3);
|
|
203
|
+
x2(ONIG_OPTION_MATCH_WHOLE_STRING, "a|abc", "a", 0, 1);
|
|
204
|
+
|
|
205
|
+
x2(ONIG_OPTION_WORD_IS_ASCII, "\\w", "@g", 1, 2);
|
|
206
|
+
n(ONIG_OPTION_WORD_IS_ASCII, "\\w", "あ");
|
|
207
|
+
x2(ONIG_OPTION_NONE, "\\d", "1", 0, 3);
|
|
208
|
+
n(ONIG_OPTION_DIGIT_IS_ASCII, "\\d", "1");
|
|
209
|
+
x2(ONIG_OPTION_SPACE_IS_ASCII, "\\s", " ", 0, 1);
|
|
210
|
+
x2(ONIG_OPTION_NONE, "\\s", " ", 0, 3);
|
|
211
|
+
n(ONIG_OPTION_SPACE_IS_ASCII, "\\s", " ");
|
|
212
|
+
|
|
213
|
+
x2(ONIG_OPTION_POSIX_IS_ASCII, "\\w\\d\\s", "c3 ", 0, 3);
|
|
214
|
+
n(ONIG_OPTION_POSIX_IS_ASCII, "\\w|\\d|\\s", "あ4 ");
|
|
215
|
+
|
|
216
|
+
x2(ONIG_OPTION_EXTEND, " abc \n def", "abcdef", 0, 6);
|
|
217
|
+
x2(ONIG_OPTION_FIND_LONGEST, "\\w+", "abc defg hij", 4, 8);
|
|
218
|
+
x2(ONIG_OPTION_FIND_NOT_EMPTY, "\\w*", "@@@ abc defg hij", 4, 7);
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
fprintf(stdout,
|
|
222
|
+
"\nRESULT SUCC: %4d, FAIL: %d, ERROR: %d (by Oniguruma %s)\n",
|
|
223
|
+
nsucc, nfail, nerror, onig_version());
|
|
224
|
+
|
|
225
|
+
onig_region_free(region, 1);
|
|
226
|
+
onig_end();
|
|
227
|
+
return ((nfail == 0 && nerror == 0) ? 0 : -1);
|
|
228
|
+
}
|
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* test_regset.c --- test for regset API
|
|
3
|
+
* Copyright (c) 2019 K.Kosako
|
|
4
|
+
*/
|
|
5
|
+
#include <stdlib.h>
|
|
6
|
+
#include <stdio.h>
|
|
7
|
+
#include <string.h>
|
|
8
|
+
#include <time.h>
|
|
9
|
+
|
|
10
|
+
#include "oniguruma.h"
|
|
11
|
+
|
|
12
|
+
static int nsucc = 0;
|
|
13
|
+
static int nfail = 0;
|
|
14
|
+
static int nerror = 0;
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
static int
|
|
18
|
+
make_regset(int line_no, int n, char* pat[], OnigRegSet** rset, int error_no)
|
|
19
|
+
{
|
|
20
|
+
int r;
|
|
21
|
+
int i;
|
|
22
|
+
OnigRegSet* set;
|
|
23
|
+
regex_t* reg;
|
|
24
|
+
OnigErrorInfo einfo;
|
|
25
|
+
|
|
26
|
+
*rset = NULL;
|
|
27
|
+
r = onig_regset_new(&set, 0, NULL);
|
|
28
|
+
if (r != 0) return r;
|
|
29
|
+
|
|
30
|
+
for (i = 0; i < n; i++) {
|
|
31
|
+
r = onig_new(®, (UChar* )pat[i], (UChar* )(pat[i] + strlen(pat[i])),
|
|
32
|
+
ONIG_OPTION_DEFAULT, ONIG_ENCODING_UTF8, ONIG_SYNTAX_DEFAULT,
|
|
33
|
+
&einfo);
|
|
34
|
+
if (r != 0) {
|
|
35
|
+
char s[ONIG_MAX_ERROR_MESSAGE_LEN];
|
|
36
|
+
|
|
37
|
+
if (error_no == 0) {
|
|
38
|
+
onig_error_code_to_str((UChar* )s, r, &einfo);
|
|
39
|
+
fprintf(stderr, "ERROR: %d: %s /%s/\n", line_no, s, pat[i]);
|
|
40
|
+
nerror++;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
if (r == error_no) {
|
|
44
|
+
fprintf(stdout, "OK(ERROR): %d: /%s/ %d\n", line_no, pat[i], r);
|
|
45
|
+
nsucc++;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
fprintf(stdout, "FAIL(ERROR): %d: /%s/ %d, %d\n",
|
|
49
|
+
line_no, pat[i], error_no, r);
|
|
50
|
+
nfail++;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
onig_regset_free(set);
|
|
54
|
+
return r;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
r = onig_regset_add(set, reg);
|
|
58
|
+
if (r != 0) {
|
|
59
|
+
onig_regset_free(set);
|
|
60
|
+
fprintf(stderr, "ERROR: %d: onig_regset_add(): /%s/\n", line_no, pat[i]);
|
|
61
|
+
nerror++;
|
|
62
|
+
return r;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
*rset = set;
|
|
67
|
+
return 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
static double
|
|
71
|
+
get_sec(clock_t start, clock_t end)
|
|
72
|
+
{
|
|
73
|
+
double t;
|
|
74
|
+
|
|
75
|
+
t = (double )(end - start) / CLOCKS_PER_SEC;
|
|
76
|
+
return t;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* use clock(), because clock_gettime() doesn't exist in Windows and old Unix. */
|
|
80
|
+
|
|
81
|
+
static int
|
|
82
|
+
time_test(int repeat, int n, char* ps[], char* s, char* end, double* rt_set, double* rt_reg)
|
|
83
|
+
{
|
|
84
|
+
int r;
|
|
85
|
+
int i;
|
|
86
|
+
int match_pos;
|
|
87
|
+
OnigRegSet* set;
|
|
88
|
+
clock_t ts1, ts2;
|
|
89
|
+
double t_set, t_reg;
|
|
90
|
+
|
|
91
|
+
r = make_regset(0, n, ps, &set, 0);
|
|
92
|
+
if (r != 0) return r;
|
|
93
|
+
|
|
94
|
+
ts1 = clock();
|
|
95
|
+
for (i = 0; i < repeat; i++) {
|
|
96
|
+
r = onig_regset_search(set, (UChar* )s, (UChar* )end, (UChar* )s, (UChar* )end,
|
|
97
|
+
ONIG_REGSET_POSITION_LEAD, ONIG_OPTION_NONE, &match_pos);
|
|
98
|
+
if (r < 0) {
|
|
99
|
+
fprintf(stderr, "FAIL onig_regset_search(POSITION_LEAD): %d\n", r);
|
|
100
|
+
onig_regset_free(set);
|
|
101
|
+
return r;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
ts2 = clock();
|
|
106
|
+
t_set = get_sec(ts1, ts2);
|
|
107
|
+
|
|
108
|
+
ts1 = clock();
|
|
109
|
+
for (i = 0; i < repeat; i++) {
|
|
110
|
+
r = onig_regset_search(set, (UChar* )s, (UChar* )end, (UChar* )s, (UChar* )end,
|
|
111
|
+
ONIG_REGSET_REGEX_LEAD, ONIG_OPTION_NONE, &match_pos);
|
|
112
|
+
if (r < 0) {
|
|
113
|
+
fprintf(stderr, "FAIL onig_regset_search(REGEX_LEAD): %d\n", r);
|
|
114
|
+
onig_regset_free(set);
|
|
115
|
+
return r;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
ts2 = clock();
|
|
120
|
+
t_reg = get_sec(ts1, ts2);
|
|
121
|
+
|
|
122
|
+
onig_regset_free(set);
|
|
123
|
+
|
|
124
|
+
*rt_set = t_set;
|
|
125
|
+
*rt_reg = t_reg;
|
|
126
|
+
return 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
static void
|
|
130
|
+
fisher_yates_shuffle(int n, char* ps[], char* cps[])
|
|
131
|
+
{
|
|
132
|
+
#define GET_RAND(n) (rand()%(n+1))
|
|
133
|
+
#define SWAP(a,b) { char* tmp = a; a = b; b = tmp; }
|
|
134
|
+
|
|
135
|
+
int i;
|
|
136
|
+
|
|
137
|
+
for (i = 0; i < n; i++)
|
|
138
|
+
cps[i] = ps[i];
|
|
139
|
+
|
|
140
|
+
for (i = n - 1; i > 0; i--) {
|
|
141
|
+
int x = GET_RAND(i);
|
|
142
|
+
SWAP(cps[i], cps[x]);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
static void
|
|
147
|
+
time_compare(int n, char* ps[], char* s, char* end)
|
|
148
|
+
{
|
|
149
|
+
int r;
|
|
150
|
+
int i;
|
|
151
|
+
int repeat;
|
|
152
|
+
double t_set, t_reg;
|
|
153
|
+
double total_set, total_reg;
|
|
154
|
+
char** cps;
|
|
155
|
+
|
|
156
|
+
cps = (char** )malloc(sizeof(char*) * n);
|
|
157
|
+
if (cps == 0) return ;
|
|
158
|
+
|
|
159
|
+
repeat = 100 / n;
|
|
160
|
+
total_set = total_reg = 0.0;
|
|
161
|
+
for (i = 0; i < n; i++) {
|
|
162
|
+
fisher_yates_shuffle(n, ps, cps);
|
|
163
|
+
r = time_test(repeat, n, cps, s, end, &t_set, &t_reg);
|
|
164
|
+
if (r != 0) {
|
|
165
|
+
free(cps);
|
|
166
|
+
return ;
|
|
167
|
+
}
|
|
168
|
+
total_set += t_set;
|
|
169
|
+
total_reg += t_reg;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
free(cps);
|
|
173
|
+
|
|
174
|
+
fprintf(stdout, "POS lead: %6.2lfmsec. REG lead: %6.2lfmsec.\n",
|
|
175
|
+
total_set * 1000.0, total_reg * 1000.0);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
static OnigRegSetLead XX_LEAD = ONIG_REGSET_POSITION_LEAD;
|
|
180
|
+
|
|
181
|
+
static void
|
|
182
|
+
xx(int line_no, int n, char* ps[], char* s, int from, int to, int mem, int not, int error_no)
|
|
183
|
+
{
|
|
184
|
+
int r;
|
|
185
|
+
int match_pos;
|
|
186
|
+
int match_index;
|
|
187
|
+
OnigRegSet* set;
|
|
188
|
+
char *end;
|
|
189
|
+
|
|
190
|
+
r = make_regset(line_no, n, ps, &set, error_no);
|
|
191
|
+
if (r != 0) return ;
|
|
192
|
+
|
|
193
|
+
end = s + strlen(s);
|
|
194
|
+
|
|
195
|
+
r = onig_regset_search(set, (UChar* )s, (UChar* )end, (UChar* )s, (UChar* )end,
|
|
196
|
+
XX_LEAD, ONIG_OPTION_NONE, &match_pos);
|
|
197
|
+
if (r < 0) {
|
|
198
|
+
if (r == ONIG_MISMATCH) {
|
|
199
|
+
if (not) {
|
|
200
|
+
fprintf(stdout, "OK(N): %d\n", line_no);
|
|
201
|
+
nsucc++;
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
fprintf(stdout, "FAIL: %d\n", line_no);
|
|
205
|
+
nfail++;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
if (error_no == 0) {
|
|
210
|
+
char buf[ONIG_MAX_ERROR_MESSAGE_LEN];
|
|
211
|
+
onig_error_code_to_str((UChar* )buf, r);
|
|
212
|
+
fprintf(stderr, "ERROR: %d: %s\n", line_no, buf);
|
|
213
|
+
nerror++;
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
if (r == error_no) {
|
|
217
|
+
fprintf(stdout, "OK(ERROR): %d: %d\n", line_no, r);
|
|
218
|
+
nsucc++;
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
fprintf(stdout, "FAIL ERROR NO: %d: %d, %d\n", line_no, error_no, r);
|
|
222
|
+
nfail++;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
if (not) {
|
|
229
|
+
fprintf(stdout, "FAIL(N): %d\n", line_no);
|
|
230
|
+
nfail++;
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
OnigRegion* region;
|
|
234
|
+
|
|
235
|
+
match_index = r;
|
|
236
|
+
region = onig_regset_get_region(set, match_index);
|
|
237
|
+
if (region == 0) {
|
|
238
|
+
fprintf(stderr, "ERROR: %d: can't get region.\n", line_no);
|
|
239
|
+
nerror++;
|
|
240
|
+
onig_regset_free(set);
|
|
241
|
+
return ;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (region->beg[mem] == from && region->end[mem] == to) {
|
|
245
|
+
fprintf(stdout, "OK: %d\n", line_no);
|
|
246
|
+
nsucc++;
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
char buf[1000];
|
|
250
|
+
int len;
|
|
251
|
+
len = region->end[mem] - region->beg[mem];
|
|
252
|
+
strncpy(buf, s + region->beg[mem], len);
|
|
253
|
+
buf[len] = '\0';
|
|
254
|
+
fprintf(stdout, "FAIL: %d: %d-%d : %d-%d (%s)\n", line_no,
|
|
255
|
+
from, to, region->beg[mem], region->end[mem], buf);
|
|
256
|
+
nfail++;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
onig_regset_free(set);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
static void
|
|
265
|
+
x2(int line_no, int n, char* ps[], char* s, int from, int to)
|
|
266
|
+
{
|
|
267
|
+
xx(line_no, n, ps, s, from, to, 0, 0, 0);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
static void
|
|
271
|
+
x3(int line_no, int n, char* ps[], char* s, int from, int to, int mem)
|
|
272
|
+
{
|
|
273
|
+
xx(line_no, n, ps, s, from, to, mem, 0, 0);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
static void
|
|
277
|
+
n(int line_no, int n, char* ps[], char* s)
|
|
278
|
+
{
|
|
279
|
+
xx(line_no, n, ps, s, 0, 0, 0, 1, 0);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
#define ASIZE(a) sizeof(a)/sizeof(a[0])
|
|
283
|
+
#define X2(ps,s,from,to) x2(__LINE__,ASIZE(ps),ps,s,from,to)
|
|
284
|
+
#define X3(ps,s,from,to,mem) x3(__LINE__,ASIZE(ps),ps,s,from,to,mem)
|
|
285
|
+
#define N(ps,s) n(__LINE__,ASIZE(ps),ps,s)
|
|
286
|
+
#define NZERO(s) n(__LINE__,0,(char** )0,s)
|
|
287
|
+
|
|
288
|
+
#ifndef _WIN32
|
|
289
|
+
|
|
290
|
+
/* getdelim() doesn't exist in Windows */
|
|
291
|
+
|
|
292
|
+
static int
|
|
293
|
+
get_all_content_of_file(char* path, char** rs, char** rend)
|
|
294
|
+
{
|
|
295
|
+
ssize_t len;
|
|
296
|
+
size_t n;
|
|
297
|
+
char* line;
|
|
298
|
+
FILE* fp;
|
|
299
|
+
|
|
300
|
+
fp = fopen(path, "r");
|
|
301
|
+
if (fp == 0) return -1;
|
|
302
|
+
|
|
303
|
+
n = 0;
|
|
304
|
+
line = NULL;
|
|
305
|
+
len = getdelim(&line, &n, EOF, fp);
|
|
306
|
+
fclose(fp);
|
|
307
|
+
if (len < 0) return -2;
|
|
308
|
+
|
|
309
|
+
*rs = line;
|
|
310
|
+
*rend = line + len;
|
|
311
|
+
return 0;
|
|
312
|
+
}
|
|
313
|
+
#endif
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
#define TEXT_PATH "kofu-utf8.txt"
|
|
317
|
+
|
|
318
|
+
/* --- To get kofu.txt ---
|
|
319
|
+
$ wget https://www.aozora.gr.jp/cards/000148/files/774_ruby_1640.zip
|
|
320
|
+
$ unzip 774_ruby_1640.zip
|
|
321
|
+
$ nkf -Lu -w8 kofu.txt > kofu-utf8.txt
|
|
322
|
+
(convert encoding to utf-8 with BOM and line terminator to be Unix-form)
|
|
323
|
+
*/
|
|
324
|
+
|
|
325
|
+
static char* p1[] = {
|
|
326
|
+
"abc",
|
|
327
|
+
"(bca)",
|
|
328
|
+
"(cab)"
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
static char* p2[] = {
|
|
332
|
+
"小説",
|
|
333
|
+
"9",
|
|
334
|
+
"夏目漱石",
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
static char* p3[] = {
|
|
338
|
+
"^いる。",
|
|
339
|
+
"^校正",
|
|
340
|
+
"^底本",
|
|
341
|
+
"^ 翌日",
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
static char* p4[] = {
|
|
345
|
+
"《[^》]{5}》",
|
|
346
|
+
"《[^》]{6}》",
|
|
347
|
+
"《[^》]{7}》",
|
|
348
|
+
"《[^》]{8}》",
|
|
349
|
+
"《[^》]{9}》",
|
|
350
|
+
"《[^》]{10}》",
|
|
351
|
+
"《[^》]{11}》",
|
|
352
|
+
"《[^》]{12}》",
|
|
353
|
+
"《[^》]{13}》",
|
|
354
|
+
"《[^》]{14}》",
|
|
355
|
+
"《[^》]{15}》",
|
|
356
|
+
"《[^》]{16}》",
|
|
357
|
+
"《[^》]{17}》",
|
|
358
|
+
"《[^》]{18}》",
|
|
359
|
+
"《[^》]{19}》",
|
|
360
|
+
"《[^》]{20}》",
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
static char* p5[] = {
|
|
364
|
+
"小室圭",
|
|
365
|
+
"bbbbbb",
|
|
366
|
+
"ドナルド・トランプ",
|
|
367
|
+
"筑摩書房",
|
|
368
|
+
"松原",
|
|
369
|
+
"aaaaaaaaa",
|
|
370
|
+
"bbbbbbbbb",
|
|
371
|
+
"ccccc",
|
|
372
|
+
"ddddddddddd",
|
|
373
|
+
"eee",
|
|
374
|
+
"ffffffffffff",
|
|
375
|
+
"gggggggggg",
|
|
376
|
+
"hhhhhhhhhhhhhh",
|
|
377
|
+
"iiiiiii",
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
static char* p6[] = {
|
|
381
|
+
"^.{1000,}",
|
|
382
|
+
"松原",
|
|
383
|
+
"小室圭",
|
|
384
|
+
"ドナルド・トランプ",
|
|
385
|
+
"筑摩書房",
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
static char* p7[] = {
|
|
389
|
+
"0+", "1+", "2+", "3+", "4+", "5+", "6+", "7+", "8+", "9+",
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
static char* p8[] = {"a", ".*"};
|
|
393
|
+
|
|
394
|
+
extern int
|
|
395
|
+
main(int argc, char* argv[])
|
|
396
|
+
{
|
|
397
|
+
#ifndef _WIN32
|
|
398
|
+
int file_exist;
|
|
399
|
+
#endif
|
|
400
|
+
int r;
|
|
401
|
+
char *s, *end;
|
|
402
|
+
OnigEncoding use_encs[1];
|
|
403
|
+
|
|
404
|
+
use_encs[0] = ONIG_ENCODING_UTF8;
|
|
405
|
+
onig_initialize(use_encs, sizeof(use_encs)/sizeof(use_encs[0]));
|
|
406
|
+
|
|
407
|
+
srand(12345);
|
|
408
|
+
|
|
409
|
+
XX_LEAD = ONIG_REGSET_POSITION_LEAD;
|
|
410
|
+
|
|
411
|
+
NZERO(" abab bccab ca");
|
|
412
|
+
X2(p1, " abab bccab ca", 8, 11);
|
|
413
|
+
X3(p1, " abab bccab ca", 8, 11, 1);
|
|
414
|
+
N(p2, " XXXX AAA 1223 012345678bbb");
|
|
415
|
+
X2(p2, "0123456789", 9, 10);
|
|
416
|
+
X2(p7, "abcde 555 qwert", 6, 9);
|
|
417
|
+
X2(p8, "", 0, 0);
|
|
418
|
+
|
|
419
|
+
XX_LEAD = ONIG_REGSET_REGEX_LEAD;
|
|
420
|
+
|
|
421
|
+
NZERO(" abab bccab ca");
|
|
422
|
+
X2(p1, " abab bccab ca", 8, 11);
|
|
423
|
+
X3(p1, " abab bccab ca", 8, 11, 1);
|
|
424
|
+
N(p2, " XXXX AAA 1223 012345678bbb");
|
|
425
|
+
X2(p2, "0123456789", 9, 10);
|
|
426
|
+
X2(p7, "abcde 555 qwert", 6, 9);
|
|
427
|
+
|
|
428
|
+
#ifndef _WIN32
|
|
429
|
+
r = get_all_content_of_file(TEXT_PATH, &s, &end);
|
|
430
|
+
if (r == 0) {
|
|
431
|
+
fprintf(stdout, "FILE: %s, size: %d\n", TEXT_PATH, (int )(end - s));
|
|
432
|
+
file_exist = 1;
|
|
433
|
+
}
|
|
434
|
+
else {
|
|
435
|
+
fprintf(stdout, "Ignore %s\n", TEXT_PATH);
|
|
436
|
+
file_exist = 0;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
if (file_exist != 0) {
|
|
440
|
+
X2(p2, s, 10, 22);
|
|
441
|
+
X2(p3, s, 496079, 496088);
|
|
442
|
+
X2(p4, s, 1294, 1315);
|
|
443
|
+
}
|
|
444
|
+
#endif
|
|
445
|
+
|
|
446
|
+
fprintf(stdout,
|
|
447
|
+
"\nRESULT SUCC: %4d, FAIL: %d, ERROR: %d (by Oniguruma %s)\n",
|
|
448
|
+
nsucc, nfail, nerror, onig_version());
|
|
449
|
+
|
|
450
|
+
#ifndef _WIN32
|
|
451
|
+
if (file_exist != 0) {
|
|
452
|
+
fprintf(stdout, "\n");
|
|
453
|
+
time_compare(ASIZE(p2), p2, s, end);
|
|
454
|
+
time_compare(ASIZE(p3), p3, s, end);
|
|
455
|
+
time_compare(ASIZE(p4), p4, s, end);
|
|
456
|
+
time_compare(ASIZE(p5), p5, s, end);
|
|
457
|
+
time_compare(ASIZE(p6), p6, s, end);
|
|
458
|
+
fprintf(stdout, "\n");
|
|
459
|
+
free(s);
|
|
460
|
+
}
|
|
461
|
+
#endif
|
|
462
|
+
|
|
463
|
+
onig_end();
|
|
464
|
+
|
|
465
|
+
return ((nfail == 0 && nerror == 0) ? 0 : -1);
|
|
466
|
+
}
|