@port-labs/jq-node-bindings 0.0.13 → 0.0.15-dev1
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 +41 -19
- 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/lib/index.js +3 -0
- package/lib/jq.js +15 -1
- package/lib/templateAsync.js +137 -0
- package/package.json +7 -7
- 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
package/deps/jq/src/compile.c
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
#ifndef _GNU_SOURCE
|
|
2
|
-
#define _GNU_SOURCE // for strdup
|
|
3
|
-
#endif
|
|
4
1
|
#include <assert.h>
|
|
5
2
|
#include <math.h>
|
|
6
3
|
#include <string.h>
|
|
@@ -49,9 +46,11 @@ struct inst {
|
|
|
49
46
|
// Unbound instructions (references to other things that may or may not
|
|
50
47
|
// exist) are created by "gen_foo_unbound", and bindings are created by
|
|
51
48
|
// block_bind(definition, body), which binds all instructions in
|
|
52
|
-
// body which are
|
|
49
|
+
// body which are unbound and refer to "definition" by name.
|
|
53
50
|
struct inst* bound_by;
|
|
54
51
|
char* symbol;
|
|
52
|
+
int any_unbound;
|
|
53
|
+
int referenced;
|
|
55
54
|
|
|
56
55
|
int nformals;
|
|
57
56
|
int nactuals;
|
|
@@ -73,6 +72,8 @@ static inst* inst_new(opcode op) {
|
|
|
73
72
|
i->bytecode_pos = -1;
|
|
74
73
|
i->bound_by = 0;
|
|
75
74
|
i->symbol = 0;
|
|
75
|
+
i->any_unbound = 0;
|
|
76
|
+
i->referenced = 0;
|
|
76
77
|
i->nformals = -1;
|
|
77
78
|
i->nactuals = -1;
|
|
78
79
|
i->subfn = gen_noop();
|
|
@@ -143,6 +144,13 @@ block gen_op_simple(opcode op) {
|
|
|
143
144
|
}
|
|
144
145
|
|
|
145
146
|
|
|
147
|
+
block gen_error(jv constant) {
|
|
148
|
+
assert(opcode_describe(ERRORK)->flags & OP_HAS_CONSTANT);
|
|
149
|
+
inst *i = inst_new(ERRORK);
|
|
150
|
+
i->imm.constant = constant;
|
|
151
|
+
return inst_block(i);
|
|
152
|
+
}
|
|
153
|
+
|
|
146
154
|
block gen_const(jv constant) {
|
|
147
155
|
assert(opcode_describe(LOADK)->flags & OP_HAS_CONSTANT);
|
|
148
156
|
inst* i = inst_new(LOADK);
|
|
@@ -156,6 +164,7 @@ block gen_const_global(jv constant, const char *name) {
|
|
|
156
164
|
inst* i = inst_new(STORE_GLOBAL);
|
|
157
165
|
i->imm.constant = constant;
|
|
158
166
|
i->symbol = strdup(name);
|
|
167
|
+
i->any_unbound = 0;
|
|
159
168
|
return inst_block(i);
|
|
160
169
|
}
|
|
161
170
|
|
|
@@ -170,12 +179,6 @@ int block_is_const(block b) {
|
|
|
170
179
|
return (block_is_single(b) && (b.first->op == LOADK || b.first->op == PUSHK_UNDER));
|
|
171
180
|
}
|
|
172
181
|
|
|
173
|
-
int block_is_const_inf(block b) {
|
|
174
|
-
return (block_is_single(b) && b.first->op == LOADK &&
|
|
175
|
-
jv_get_kind(b.first->imm.constant) == JV_KIND_NUMBER &&
|
|
176
|
-
isinf(jv_number_value(b.first->imm.constant)));
|
|
177
|
-
}
|
|
178
|
-
|
|
179
182
|
jv_kind block_const_kind(block b) {
|
|
180
183
|
assert(block_is_const(b));
|
|
181
184
|
return jv_get_kind(b.first->imm.constant);
|
|
@@ -211,19 +214,22 @@ block gen_op_unbound(opcode op, const char* name) {
|
|
|
211
214
|
assert(opcode_describe(op)->flags & OP_HAS_BINDING);
|
|
212
215
|
inst* i = inst_new(op);
|
|
213
216
|
i->symbol = strdup(name);
|
|
217
|
+
i->any_unbound = 1;
|
|
214
218
|
return inst_block(i);
|
|
215
219
|
}
|
|
216
220
|
|
|
217
221
|
block gen_op_var_fresh(opcode op, const char* name) {
|
|
218
222
|
assert(opcode_describe(op)->flags & OP_HAS_VARIABLE);
|
|
219
|
-
|
|
220
|
-
|
|
223
|
+
block b = gen_op_unbound(op, name);
|
|
224
|
+
b.first->bound_by = b.first;
|
|
225
|
+
return b;
|
|
221
226
|
}
|
|
222
227
|
|
|
223
228
|
block gen_op_bound(opcode op, block binder) {
|
|
224
229
|
assert(block_is_single(binder));
|
|
225
230
|
block b = gen_op_unbound(op, binder.first->symbol);
|
|
226
231
|
b.first->bound_by = binder.first;
|
|
232
|
+
b.first->any_unbound = 0;
|
|
227
233
|
return b;
|
|
228
234
|
}
|
|
229
235
|
|
|
@@ -282,18 +288,6 @@ int block_has_only_binders(block binders, int bindflags) {
|
|
|
282
288
|
return 1;
|
|
283
289
|
}
|
|
284
290
|
|
|
285
|
-
// Count a binder's (function) formal params
|
|
286
|
-
static int block_count_formals(block b) {
|
|
287
|
-
int args = 0;
|
|
288
|
-
if (b.first->op == CLOSURE_CREATE_C)
|
|
289
|
-
return b.first->imm.cfunc->nargs - 1;
|
|
290
|
-
for (inst* i = b.first->arglist.first; i; i = i->next) {
|
|
291
|
-
assert(i->op == CLOSURE_PARAM);
|
|
292
|
-
args++;
|
|
293
|
-
}
|
|
294
|
-
return args;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
291
|
// Count a call site's actual params
|
|
298
292
|
static int block_count_actuals(block b) {
|
|
299
293
|
int args = 0;
|
|
@@ -310,21 +304,7 @@ static int block_count_actuals(block b) {
|
|
|
310
304
|
return args;
|
|
311
305
|
}
|
|
312
306
|
|
|
313
|
-
static int
|
|
314
|
-
int nrefs = 0;
|
|
315
|
-
for (inst* i = body.first; i; i = i->next) {
|
|
316
|
-
if (i != binder.first && i->bound_by == binder.first) {
|
|
317
|
-
nrefs++;
|
|
318
|
-
}
|
|
319
|
-
// counting recurses into closures
|
|
320
|
-
nrefs += block_count_refs(binder, i->subfn);
|
|
321
|
-
// counting recurses into argument list
|
|
322
|
-
nrefs += block_count_refs(binder, i->arglist);
|
|
323
|
-
}
|
|
324
|
-
return nrefs;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
static int block_bind_subblock(block binder, block body, int bindflags, int break_distance) {
|
|
307
|
+
static int block_bind_subblock_inner(int* any_unbound, block binder, block body, int bindflags, int break_distance) {
|
|
328
308
|
assert(block_is_single(binder));
|
|
329
309
|
assert((opcode_describe(binder.first->op)->flags & bindflags) == (bindflags & ~OP_BIND_WILDCARD));
|
|
330
310
|
assert(binder.first->symbol);
|
|
@@ -332,10 +312,11 @@ static int block_bind_subblock(block binder, block body, int bindflags, int brea
|
|
|
332
312
|
assert(break_distance >= 0);
|
|
333
313
|
|
|
334
314
|
binder.first->bound_by = binder.first;
|
|
335
|
-
if (binder.first->nformals == -1)
|
|
336
|
-
binder.first->nformals = block_count_formals(binder);
|
|
337
315
|
int nrefs = 0;
|
|
338
316
|
for (inst* i = body.first; i; i = i->next) {
|
|
317
|
+
if (i->any_unbound == 0)
|
|
318
|
+
continue;
|
|
319
|
+
|
|
339
320
|
int flags = opcode_describe(i->op)->flags;
|
|
340
321
|
if ((flags & bindflags) == (bindflags & ~OP_BIND_WILDCARD) && i->bound_by == 0 &&
|
|
341
322
|
(!strcmp(i->symbol, binder.first->symbol) ||
|
|
@@ -344,8 +325,6 @@ static int block_bind_subblock(block binder, block body, int bindflags, int brea
|
|
|
344
325
|
break_distance <= 3 && (i->symbol[1] == '1' + break_distance) &&
|
|
345
326
|
i->symbol[2] == '\0'))) {
|
|
346
327
|
// bind this instruction
|
|
347
|
-
if (i->op == CALL_JQ && i->nactuals == -1)
|
|
348
|
-
i->nactuals = block_count_actuals(i->arglist);
|
|
349
328
|
if (i->nactuals == -1 || i->nactuals == binder.first->nformals) {
|
|
350
329
|
i->bound_by = binder.first;
|
|
351
330
|
nrefs++;
|
|
@@ -357,14 +336,25 @@ static int block_bind_subblock(block binder, block body, int bindflags, int brea
|
|
|
357
336
|
// a break whenever we come across a STOREV of *anonlabel...
|
|
358
337
|
break_distance++;
|
|
359
338
|
}
|
|
339
|
+
|
|
340
|
+
i->any_unbound = (i->symbol && !i->bound_by);
|
|
341
|
+
|
|
360
342
|
// binding recurses into closures
|
|
361
|
-
nrefs +=
|
|
343
|
+
nrefs += block_bind_subblock_inner(&i->any_unbound, binder, i->subfn, bindflags, break_distance);
|
|
362
344
|
// binding recurses into argument list
|
|
363
|
-
nrefs +=
|
|
345
|
+
nrefs += block_bind_subblock_inner(&i->any_unbound, binder, i->arglist, bindflags, break_distance);
|
|
346
|
+
|
|
347
|
+
if (i->any_unbound)
|
|
348
|
+
*any_unbound = 1;
|
|
364
349
|
}
|
|
365
350
|
return nrefs;
|
|
366
351
|
}
|
|
367
352
|
|
|
353
|
+
static int block_bind_subblock(block binder, block body, int bindflags, int break_distance) {
|
|
354
|
+
int any_unbound;
|
|
355
|
+
return block_bind_subblock_inner(&any_unbound, binder, body, bindflags, break_distance);
|
|
356
|
+
}
|
|
357
|
+
|
|
368
358
|
static int block_bind_each(block binder, block body, int bindflags) {
|
|
369
359
|
assert(block_has_only_binders(binder, bindflags));
|
|
370
360
|
bindflags |= OP_HAS_BINDING;
|
|
@@ -375,14 +365,13 @@ static int block_bind_each(block binder, block body, int bindflags) {
|
|
|
375
365
|
return nrefs;
|
|
376
366
|
}
|
|
377
367
|
|
|
378
|
-
block block_bind(block binder, block body, int bindflags) {
|
|
368
|
+
static block block_bind(block binder, block body, int bindflags) {
|
|
379
369
|
block_bind_each(binder, body, bindflags);
|
|
380
370
|
return block_join(binder, body);
|
|
381
371
|
}
|
|
382
372
|
|
|
383
373
|
block block_bind_library(block binder, block body, int bindflags, const char *libname) {
|
|
384
374
|
bindflags |= OP_HAS_BINDING;
|
|
385
|
-
int nrefs = 0;
|
|
386
375
|
int matchlen = (libname == NULL) ? 0 : strlen(libname);
|
|
387
376
|
char *matchname = jv_mem_alloc(matchlen+2+1);
|
|
388
377
|
matchname[0] = '\0';
|
|
@@ -392,7 +381,7 @@ block block_bind_library(block binder, block body, int bindflags, const char *li
|
|
|
392
381
|
matchlen += 2;
|
|
393
382
|
}
|
|
394
383
|
assert(block_has_only_binders(binder, bindflags));
|
|
395
|
-
for (inst *curr = binder.
|
|
384
|
+
for (inst *curr = binder.last; curr; curr = curr->prev) {
|
|
396
385
|
int bindflags2 = bindflags;
|
|
397
386
|
char* cname = curr->symbol;
|
|
398
387
|
char* tname = jv_mem_alloc(strlen(curr->symbol)+matchlen+1);
|
|
@@ -405,7 +394,7 @@ block block_bind_library(block binder, block body, int bindflags, const char *li
|
|
|
405
394
|
|
|
406
395
|
// This mutation is ugly, even if we undo it
|
|
407
396
|
curr->symbol = tname;
|
|
408
|
-
|
|
397
|
+
block_bind_subblock(inst_block(curr), body, bindflags2, 0);
|
|
409
398
|
curr->symbol = cname;
|
|
410
399
|
free(tname);
|
|
411
400
|
}
|
|
@@ -413,72 +402,92 @@ block block_bind_library(block binder, block body, int bindflags, const char *li
|
|
|
413
402
|
return body; // We don't return a join because we don't want those sticking around...
|
|
414
403
|
}
|
|
415
404
|
|
|
416
|
-
|
|
417
|
-
|
|
405
|
+
static inst* block_take_last(block* b) {
|
|
406
|
+
inst* i = b->last;
|
|
407
|
+
if (i == 0)
|
|
408
|
+
return 0;
|
|
409
|
+
if (i->prev) {
|
|
410
|
+
i->prev->next = i->next;
|
|
411
|
+
b->last = i->prev;
|
|
412
|
+
i->prev = 0;
|
|
413
|
+
} else {
|
|
414
|
+
b->first = 0;
|
|
415
|
+
b->last = 0;
|
|
416
|
+
}
|
|
417
|
+
return i;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// Binds a sequence of binders, which *must not* already be bound to each other,
|
|
421
|
+
// to body, throwing away unreferenced defs
|
|
418
422
|
block block_bind_referenced(block binder, block body, int bindflags) {
|
|
419
423
|
assert(block_has_only_binders(binder, bindflags));
|
|
420
424
|
bindflags |= OP_HAS_BINDING;
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
// already know are referenced by body.
|
|
430
|
-
nrefs += block_count_refs(b, refd);
|
|
431
|
-
nrefs += block_count_refs(b, body);
|
|
432
|
-
if (nrefs) {
|
|
433
|
-
refd = BLOCK(refd, b);
|
|
434
|
-
kept++;
|
|
435
|
-
} else {
|
|
436
|
-
unrefd = BLOCK(unrefd, b);
|
|
437
|
-
}
|
|
425
|
+
|
|
426
|
+
inst* curr;
|
|
427
|
+
while ((curr = block_take_last(&binder))) {
|
|
428
|
+
block b = inst_block(curr);
|
|
429
|
+
if (block_bind_subblock(b, body, bindflags, 0) == 0) {
|
|
430
|
+
block_free(b);
|
|
431
|
+
} else {
|
|
432
|
+
body = BLOCK(b, body);
|
|
438
433
|
}
|
|
439
|
-
if (kept == last_kept)
|
|
440
|
-
break;
|
|
441
|
-
last_kept = kept;
|
|
442
|
-
binder = unrefd;
|
|
443
|
-
unrefd = gen_noop();
|
|
444
434
|
}
|
|
445
|
-
|
|
446
|
-
return block_join(refd, body);
|
|
435
|
+
return body;
|
|
447
436
|
}
|
|
448
437
|
|
|
449
|
-
block
|
|
438
|
+
block block_bind_self(block binder, int bindflags) {
|
|
439
|
+
assert(block_has_only_binders(binder, bindflags));
|
|
440
|
+
bindflags |= OP_HAS_BINDING;
|
|
441
|
+
block body = gen_noop();
|
|
442
|
+
|
|
450
443
|
inst* curr;
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
444
|
+
while ((curr = block_take_last(&binder))) {
|
|
445
|
+
block b = inst_block(curr);
|
|
446
|
+
block_bind_subblock(b, body, bindflags, 0);
|
|
447
|
+
body = BLOCK(b, body);
|
|
448
|
+
}
|
|
449
|
+
return body;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
static void block_mark_referenced(block body) {
|
|
453
|
+
int saw_top = 0;
|
|
454
|
+
for (inst* i = body.last; i; i = i->prev) {
|
|
455
|
+
if (saw_top && i->bound_by == i && !i->referenced)
|
|
456
|
+
continue;
|
|
457
|
+
if (i->op == TOP) {
|
|
458
|
+
saw_top = 1;
|
|
464
459
|
}
|
|
465
|
-
if (
|
|
466
|
-
|
|
460
|
+
if (i->bound_by) {
|
|
461
|
+
i->bound_by->referenced = 1;
|
|
467
462
|
}
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
463
|
+
|
|
464
|
+
block_mark_referenced(i->arglist);
|
|
465
|
+
block_mark_referenced(i->subfn);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
block block_drop_unreferenced(block body) {
|
|
470
|
+
block_mark_referenced(body);
|
|
471
|
+
|
|
472
|
+
block refd = gen_noop();
|
|
473
|
+
inst* curr;
|
|
474
|
+
while ((curr = block_take(&body))) {
|
|
475
|
+
if (curr->bound_by == curr && !curr->referenced) {
|
|
476
|
+
inst_free(curr);
|
|
477
|
+
} else {
|
|
478
|
+
refd = BLOCK(refd, inst_block(curr));
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
return refd;
|
|
473
482
|
}
|
|
474
483
|
|
|
475
484
|
jv block_take_imports(block* body) {
|
|
476
485
|
jv imports = jv_array();
|
|
477
486
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
487
|
+
/* Parser should never generate TOP before imports */
|
|
488
|
+
assert(!(body->first && body->first->op == TOP && body->first->next &&
|
|
489
|
+
(body->first->next->op == MODULEMETA || body->first->next->op == DEPS)));
|
|
490
|
+
|
|
482
491
|
while (body->first && (body->first->op == MODULEMETA || body->first->op == DEPS)) {
|
|
483
492
|
inst* dep = block_take(body);
|
|
484
493
|
if (dep->op == DEPS) {
|
|
@@ -486,9 +495,6 @@ jv block_take_imports(block* body) {
|
|
|
486
495
|
}
|
|
487
496
|
inst_free(dep);
|
|
488
497
|
}
|
|
489
|
-
if (top) {
|
|
490
|
-
*body = block_join(inst_block(top),*body);
|
|
491
|
-
}
|
|
492
498
|
return imports;
|
|
493
499
|
}
|
|
494
500
|
|
|
@@ -505,6 +511,7 @@ jv block_list_funcs(block body, int omit_underscores) {
|
|
|
505
511
|
}
|
|
506
512
|
|
|
507
513
|
block gen_module(block metadata) {
|
|
514
|
+
assert(block_is_const(metadata) && block_const_kind(metadata) == JV_KIND_OBJECT);
|
|
508
515
|
inst* i = inst_new(MODULEMETA);
|
|
509
516
|
i->imm.constant = block_const(metadata);
|
|
510
517
|
if (jv_get_kind(i->imm.constant) != JV_KIND_OBJECT)
|
|
@@ -541,7 +548,10 @@ block gen_import_meta(block import, block metadata) {
|
|
|
541
548
|
|
|
542
549
|
block gen_function(const char* name, block formals, block body) {
|
|
543
550
|
inst* i = inst_new(CLOSURE_CREATE);
|
|
551
|
+
int nformals = 0;
|
|
544
552
|
for (inst* i = formals.last; i; i = i->prev) {
|
|
553
|
+
nformals++;
|
|
554
|
+
i->nformals = 0;
|
|
545
555
|
if (i->op == CLOSURE_PARAM_REGULAR) {
|
|
546
556
|
i->op = CLOSURE_PARAM;
|
|
547
557
|
body = gen_var_binding(gen_call(i->symbol, gen_noop()), i->symbol, body);
|
|
@@ -550,6 +560,8 @@ block gen_function(const char* name, block formals, block body) {
|
|
|
550
560
|
}
|
|
551
561
|
i->subfn = body;
|
|
552
562
|
i->symbol = strdup(name);
|
|
563
|
+
i->any_unbound = -1;
|
|
564
|
+
i->nformals = nformals;
|
|
553
565
|
i->arglist = formals;
|
|
554
566
|
block b = inst_block(i);
|
|
555
567
|
block_bind_subblock(b, b, OP_IS_CALL_PSEUDO | OP_HAS_BINDING, 0);
|
|
@@ -571,6 +583,7 @@ block gen_lambda(block body) {
|
|
|
571
583
|
block gen_call(const char* name, block args) {
|
|
572
584
|
block b = gen_op_unbound(CALL_JQ, name);
|
|
573
585
|
b.first->arglist = args;
|
|
586
|
+
b.first->nactuals = block_count_actuals(b.first->arglist);
|
|
574
587
|
return b;
|
|
575
588
|
}
|
|
576
589
|
|
|
@@ -819,7 +832,7 @@ block gen_reduce(block source, block matcher, block init, block body) {
|
|
|
819
832
|
block loop = BLOCK(gen_op_simple(DUPN),
|
|
820
833
|
source,
|
|
821
834
|
bind_alternation_matchers(matcher,
|
|
822
|
-
BLOCK(gen_op_bound(
|
|
835
|
+
BLOCK(gen_op_bound(LOADV, res_var),
|
|
823
836
|
body,
|
|
824
837
|
gen_op_bound(STOREV, res_var))),
|
|
825
838
|
gen_op_simple(BACKTRACK));
|
|
@@ -841,7 +854,7 @@ block gen_foreach(block source, block matcher, block init, block update, block e
|
|
|
841
854
|
// in the body to see
|
|
842
855
|
bind_alternation_matchers(matcher,
|
|
843
856
|
// load the loop state variable
|
|
844
|
-
BLOCK(gen_op_bound(
|
|
857
|
+
BLOCK(gen_op_bound(LOADV, state_var),
|
|
845
858
|
// generate updated state
|
|
846
859
|
update,
|
|
847
860
|
// save the updated state for value extraction
|
|
@@ -1018,43 +1031,40 @@ block gen_cond(block cond, block iftrue, block iffalse) {
|
|
|
1018
1031
|
BLOCK(gen_op_simple(POP), iffalse)));
|
|
1019
1032
|
}
|
|
1020
1033
|
|
|
1021
|
-
block gen_try_handler(block handler) {
|
|
1022
|
-
// Quite a pain just to hide jq's internal errors.
|
|
1023
|
-
return gen_cond(// `if type=="object" and .__jq
|
|
1024
|
-
gen_and(gen_call("_equal",
|
|
1025
|
-
BLOCK(gen_lambda(gen_const(jv_string("object"))),
|
|
1026
|
-
gen_lambda(gen_noop()))),
|
|
1027
|
-
BLOCK(gen_subexp(gen_const(jv_string("__jq"))),
|
|
1028
|
-
gen_noop(),
|
|
1029
|
-
gen_op_simple(INDEX))),
|
|
1030
|
-
// `then error`
|
|
1031
|
-
gen_call("error", gen_noop()),
|
|
1032
|
-
// `else HANDLER end`
|
|
1033
|
-
handler);
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
1034
|
block gen_try(block exp, block handler) {
|
|
1037
1035
|
/*
|
|
1038
|
-
* Produce
|
|
1039
|
-
*
|
|
1036
|
+
* Produce:
|
|
1037
|
+
*
|
|
1038
|
+
* TRY_BEGIN handler
|
|
1040
1039
|
* <exp>
|
|
1041
|
-
*
|
|
1042
|
-
*
|
|
1040
|
+
* TRY_END
|
|
1041
|
+
* JUMP past_handler
|
|
1042
|
+
* handler: <handler>
|
|
1043
|
+
* past_handler:
|
|
1043
1044
|
*
|
|
1044
|
-
* If
|
|
1045
|
-
* internal errors to prevent them from leaking.
|
|
1045
|
+
* If <exp> backtracks then TRY_BEGIN will backtrack.
|
|
1046
1046
|
*
|
|
1047
|
-
*
|
|
1048
|
-
*
|
|
1049
|
-
*
|
|
1050
|
-
*
|
|
1051
|
-
*
|
|
1047
|
+
* If <exp> produces a value then we'll execute whatever bytecode follows
|
|
1048
|
+
* this sequence. If that code raises an exception, then TRY_END will wrap
|
|
1049
|
+
* and re-raise that exception, and TRY_BEGIN will unwrap and re-raise the
|
|
1050
|
+
* exception (see jq_next()).
|
|
1051
|
+
*
|
|
1052
|
+
* If <exp> raises then the TRY_BEGIN will see a non-wrapped exception and
|
|
1053
|
+
* will jump to the handler (note the TRY_END will not execute in this case),
|
|
1054
|
+
* and if the handler produces any values, then we'll execute whatever
|
|
1055
|
+
* bytecode follows this sequence. Note that TRY_END will not execute in
|
|
1056
|
+
* this case, so if the handler raises an exception, or code past the handler
|
|
1057
|
+
* raises an exception, then that exception won't be wrapped and re-raised,
|
|
1058
|
+
* and the TRY_BEGIN will not catch it because it does not stack_save() when
|
|
1059
|
+
* it branches to the handler.
|
|
1052
1060
|
*/
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
handler = BLOCK(gen_op_simple(DUP), gen_op_simple(POP)
|
|
1056
|
-
|
|
1057
|
-
|
|
1061
|
+
|
|
1062
|
+
if (block_is_noop(handler))
|
|
1063
|
+
handler = BLOCK(gen_op_simple(DUP), gen_op_simple(POP));
|
|
1064
|
+
|
|
1065
|
+
block jump = gen_op_target(JUMP, handler);
|
|
1066
|
+
return BLOCK(gen_op_target(TRY_BEGIN, jump), exp, gen_op_simple(TRY_END),
|
|
1067
|
+
jump, handler);
|
|
1058
1068
|
}
|
|
1059
1069
|
|
|
1060
1070
|
block gen_label(const char *label, block exp) {
|
|
@@ -1080,8 +1090,10 @@ block gen_cbinding(const struct cfunction* cfunctions, int ncfunctions, block co
|
|
|
1080
1090
|
for (int cfunc=0; cfunc<ncfunctions; cfunc++) {
|
|
1081
1091
|
inst* i = inst_new(CLOSURE_CREATE_C);
|
|
1082
1092
|
i->imm.cfunc = &cfunctions[cfunc];
|
|
1083
|
-
i->symbol = strdup(
|
|
1084
|
-
|
|
1093
|
+
i->symbol = strdup(cfunctions[cfunc].name);
|
|
1094
|
+
i->nformals = cfunctions[cfunc].nargs - 1;
|
|
1095
|
+
i->any_unbound = 0;
|
|
1096
|
+
code = BLOCK(inst_block(i), code);
|
|
1085
1097
|
}
|
|
1086
1098
|
return code;
|
|
1087
1099
|
}
|
|
@@ -1147,7 +1159,7 @@ static int expand_call_arglist(block* b, jv args, jv *env) {
|
|
|
1147
1159
|
else if (curr->op == LOADV)
|
|
1148
1160
|
locfile_locate(curr->locfile, curr->source, "jq: error: $%s is not defined", curr->symbol);
|
|
1149
1161
|
else
|
|
1150
|
-
locfile_locate(curr->locfile, curr->source, "jq: error: %s/%d is not defined", curr->symbol,
|
|
1162
|
+
locfile_locate(curr->locfile, curr->source, "jq: error: %s/%d is not defined", curr->symbol, curr->nactuals);
|
|
1151
1163
|
errors++;
|
|
1152
1164
|
// don't process this instruction if it's not well-defined
|
|
1153
1165
|
ret = BLOCK(ret, inst_block(curr));
|
|
@@ -1269,8 +1281,8 @@ static int compile(struct bytecode* bc, block b, struct locfile* lf, jv args, jv
|
|
|
1269
1281
|
}
|
|
1270
1282
|
bc->codelen = pos;
|
|
1271
1283
|
bc->debuginfo = jv_object_set(bc->debuginfo, jv_string("locals"), localnames);
|
|
1272
|
-
if (bc->nsubfunctions) {
|
|
1273
|
-
bc->subfunctions = jv_mem_calloc(sizeof(struct bytecode*)
|
|
1284
|
+
if (bc->nsubfunctions && !errors) {
|
|
1285
|
+
bc->subfunctions = jv_mem_calloc(bc->nsubfunctions, sizeof(struct bytecode*));
|
|
1274
1286
|
for (inst* curr = b.first; curr; curr = curr->next) {
|
|
1275
1287
|
if (curr->op == CLOSURE_CREATE) {
|
|
1276
1288
|
struct bytecode* subfn = jv_mem_alloc(sizeof(struct bytecode));
|
|
@@ -1293,9 +1305,10 @@ static int compile(struct bytecode* bc, block b, struct locfile* lf, jv args, jv
|
|
|
1293
1305
|
}
|
|
1294
1306
|
}
|
|
1295
1307
|
} else {
|
|
1308
|
+
bc->nsubfunctions = 0;
|
|
1296
1309
|
bc->subfunctions = 0;
|
|
1297
1310
|
}
|
|
1298
|
-
uint16_t* code = jv_mem_calloc(sizeof(uint16_t)
|
|
1311
|
+
uint16_t* code = jv_mem_calloc(bc->codelen, sizeof(uint16_t));
|
|
1299
1312
|
bc->code = code;
|
|
1300
1313
|
pos = 0;
|
|
1301
1314
|
jv constant_pool = jv_array();
|
|
@@ -1330,6 +1343,7 @@ static int compile(struct bytecode* bc, block b, struct locfile* lf, jv args, jv
|
|
|
1330
1343
|
code[pos++] = nesting_level(bc, curr->bound_by);
|
|
1331
1344
|
uint16_t var = (uint16_t)curr->bound_by->imm.intval;
|
|
1332
1345
|
code[pos++] = var;
|
|
1346
|
+
if (var > maxvar) maxvar = var;
|
|
1333
1347
|
} else if (op->flags & OP_HAS_CONSTANT) {
|
|
1334
1348
|
code[pos++] = jv_array_length(jv_copy(constant_pool));
|
|
1335
1349
|
constant_pool = jv_array_append(constant_pool, jv_copy(curr->imm.constant));
|
|
@@ -1360,7 +1374,7 @@ int block_compile(block b, struct bytecode** out, struct locfile* lf, jv args) {
|
|
|
1360
1374
|
bc->globals = jv_mem_alloc(sizeof(struct symbol_table));
|
|
1361
1375
|
int ncfunc = count_cfunctions(b);
|
|
1362
1376
|
bc->globals->ncfunctions = 0;
|
|
1363
|
-
bc->globals->cfunctions = jv_mem_calloc(sizeof(struct cfunction)
|
|
1377
|
+
bc->globals->cfunctions = jv_mem_calloc(ncfunc, sizeof(struct cfunction));
|
|
1364
1378
|
bc->globals->cfunc_names = jv_array();
|
|
1365
1379
|
bc->debuginfo = jv_object_set(jv_object(), jv_string("name"), jv_null());
|
|
1366
1380
|
jv env = jv_invalid();
|
package/deps/jq/src/compile.h
CHANGED
|
@@ -19,10 +19,10 @@ block gen_location(location, struct locfile*, block);
|
|
|
19
19
|
block gen_noop();
|
|
20
20
|
int block_is_noop(block b);
|
|
21
21
|
block gen_op_simple(opcode op);
|
|
22
|
+
block gen_error(jv constant);
|
|
22
23
|
block gen_const(jv constant);
|
|
23
24
|
block gen_const_global(jv constant, const char *name);
|
|
24
25
|
int block_is_const(block b);
|
|
25
|
-
int block_is_const_inf(block b);
|
|
26
26
|
jv_kind block_const_kind(block b);
|
|
27
27
|
jv block_const(block b);
|
|
28
28
|
block gen_op_target(opcode op, block target);
|
|
@@ -59,7 +59,6 @@ block gen_destructure(block var, block matcher, block body);
|
|
|
59
59
|
block gen_destructure_alt(block matcher);
|
|
60
60
|
|
|
61
61
|
block gen_cond(block cond, block iftrue, block iffalse);
|
|
62
|
-
block gen_try_handler(block handler);
|
|
63
62
|
block gen_try(block exp, block handler);
|
|
64
63
|
block gen_label(const char *label, block exp);
|
|
65
64
|
|
|
@@ -72,9 +71,9 @@ int block_has_only_binders(block, int bindflags);
|
|
|
72
71
|
int block_has_main(block);
|
|
73
72
|
int block_is_funcdef(block b);
|
|
74
73
|
int block_is_single(block b);
|
|
75
|
-
block block_bind(block binder, block body, int bindflags);
|
|
76
74
|
block block_bind_library(block binder, block body, int bindflags, const char* libname);
|
|
77
75
|
block block_bind_referenced(block binder, block body, int bindflags);
|
|
76
|
+
block block_bind_self(block binder, int bindflags);
|
|
78
77
|
block block_drop_unreferenced(block body);
|
|
79
78
|
|
|
80
79
|
jv block_take_imports(block* body);
|
|
@@ -87,7 +86,7 @@ void block_free(block);
|
|
|
87
86
|
|
|
88
87
|
|
|
89
88
|
// Here's some horrible preprocessor gunk so that code
|
|
90
|
-
// sequences can be
|
|
89
|
+
// sequences can be constructed as BLOCK(block1, block2, block3)
|
|
91
90
|
|
|
92
91
|
#define BLOCK_1(b1) (b1)
|
|
93
92
|
#define BLOCK_2(b1,b2) (block_join((b1),(b2)))
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></meta>
|
|
5
|
+
<title>ICU License - ICU 1.8.1 and later</title>
|
|
6
|
+
</head>
|
|
7
|
+
|
|
8
|
+
<body>
|
|
9
|
+
<h1>ICU License - ICU 1.8.1 and later</h1>
|
|
10
|
+
<pre>
|
|
11
|
+
COPYRIGHT AND PERMISSION NOTICE
|
|
12
|
+
|
|
13
|
+
Copyright (c) 1995-2005 International Business Machines Corporation and others
|
|
14
|
+
All rights reserved.
|
|
15
|
+
|
|
16
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
17
|
+
copy of this software and associated documentation files (the
|
|
18
|
+
"Software"), to deal in the Software without restriction, including
|
|
19
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
20
|
+
distribute, and/or sell copies of the Software, and to permit persons
|
|
21
|
+
to whom the Software is furnished to do so, provided that the above
|
|
22
|
+
copyright notice(s) and this permission notice appear in all copies of
|
|
23
|
+
the Software and that both the above copyright notice(s) and this
|
|
24
|
+
permission notice appear in supporting documentation.
|
|
25
|
+
|
|
26
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
27
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
28
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
29
|
+
OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
30
|
+
HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
|
|
31
|
+
INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
|
|
32
|
+
FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
|
33
|
+
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
|
34
|
+
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
35
|
+
|
|
36
|
+
Except as contained in this notice, the name of a copyright holder
|
|
37
|
+
shall not be used in advertising or otherwise to promote the sale, use
|
|
38
|
+
or other dealings in this Software without prior written authorization
|
|
39
|
+
of the copyright holder.
|
|
40
|
+
|
|
41
|
+
--------------------------------------------------------------------------------
|
|
42
|
+
All trademarks and registered trademarks mentioned herein are the property of their respective owners.
|
|
43
|
+
</pre>
|
|
44
|
+
</body>
|
|
45
|
+
</html>
|