@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/jv_parse.c
CHANGED
|
@@ -124,14 +124,19 @@ static void parser_free(struct jv_parser* p) {
|
|
|
124
124
|
|
|
125
125
|
static pfunc value(struct jv_parser* p, jv val) {
|
|
126
126
|
if ((p->flags & JV_PARSE_STREAMING)) {
|
|
127
|
-
if (jv_is_valid(p->next) || p->last_seen == JV_LAST_VALUE)
|
|
127
|
+
if (jv_is_valid(p->next) || p->last_seen == JV_LAST_VALUE) {
|
|
128
|
+
jv_free(val);
|
|
128
129
|
return "Expected separator between values";
|
|
130
|
+
}
|
|
129
131
|
if (p->stacklen > 0)
|
|
130
132
|
p->last_seen = JV_LAST_VALUE;
|
|
131
133
|
else
|
|
132
134
|
p->last_seen = JV_LAST_NONE;
|
|
133
135
|
} else {
|
|
134
|
-
if (jv_is_valid(p->next))
|
|
136
|
+
if (jv_is_valid(p->next)) {
|
|
137
|
+
jv_free(val);
|
|
138
|
+
return "Expected separator between values";
|
|
139
|
+
}
|
|
135
140
|
}
|
|
136
141
|
jv_free(p->next);
|
|
137
142
|
p->next = val;
|
|
@@ -241,6 +246,17 @@ static pfunc stream_token(struct jv_parser* p, char ch) {
|
|
|
241
246
|
case '[':
|
|
242
247
|
if (jv_is_valid(p->next))
|
|
243
248
|
return "Expected a separator between values";
|
|
249
|
+
if (p->last_seen == JV_LAST_OPEN_OBJECT)
|
|
250
|
+
// Looks like {["foo"]}
|
|
251
|
+
return "Expected string key after '{', not '['";
|
|
252
|
+
if (p->last_seen == JV_LAST_COMMA) {
|
|
253
|
+
last = jv_array_get(jv_copy(p->path), p->stacklen - 1);
|
|
254
|
+
k = jv_get_kind(last);
|
|
255
|
+
jv_free(last);
|
|
256
|
+
if (k != JV_KIND_NUMBER)
|
|
257
|
+
// Looks like {"x":"y",["foo"]}
|
|
258
|
+
return "Expected string key after ',' in object, not '['";
|
|
259
|
+
}
|
|
244
260
|
p->path = jv_array_append(p->path, jv_number(0)); // push
|
|
245
261
|
p->last_seen = JV_LAST_OPEN_ARRAY;
|
|
246
262
|
p->stacklen++;
|
|
@@ -249,6 +265,17 @@ static pfunc stream_token(struct jv_parser* p, char ch) {
|
|
|
249
265
|
case '{':
|
|
250
266
|
if (p->last_seen == JV_LAST_VALUE)
|
|
251
267
|
return "Expected a separator between values";
|
|
268
|
+
if (p->last_seen == JV_LAST_OPEN_OBJECT)
|
|
269
|
+
// Looks like {{"foo":"bar"}}
|
|
270
|
+
return "Expected string key after '{', not '{'";
|
|
271
|
+
if (p->last_seen == JV_LAST_COMMA) {
|
|
272
|
+
last = jv_array_get(jv_copy(p->path), p->stacklen - 1);
|
|
273
|
+
k = jv_get_kind(last);
|
|
274
|
+
jv_free(last);
|
|
275
|
+
if (k != JV_KIND_NUMBER)
|
|
276
|
+
// Looks like {"x":"y",{"foo":"bar"}}
|
|
277
|
+
return "Expected string key after ',' in object, not '{'";
|
|
278
|
+
}
|
|
252
279
|
// Push object key: null, since we don't know it yet
|
|
253
280
|
p->path = jv_array_append(p->path, jv_null()); // push
|
|
254
281
|
p->last_seen = JV_LAST_OPEN_OBJECT;
|
|
@@ -256,8 +283,12 @@ static pfunc stream_token(struct jv_parser* p, char ch) {
|
|
|
256
283
|
break;
|
|
257
284
|
|
|
258
285
|
case ':':
|
|
259
|
-
|
|
286
|
+
last = jv_invalid();
|
|
287
|
+
if (p->stacklen == 0 || jv_get_kind(last = jv_array_get(jv_copy(p->path), p->stacklen - 1)) == JV_KIND_NUMBER) {
|
|
288
|
+
jv_free(last);
|
|
260
289
|
return "':' not as part of an object";
|
|
290
|
+
}
|
|
291
|
+
jv_free(last);
|
|
261
292
|
if (!jv_is_valid(p->next) || p->last_seen == JV_LAST_NONE)
|
|
262
293
|
return "Expected string key before ':'";
|
|
263
294
|
if (jv_get_kind(p->next) != JV_KIND_STRING)
|
|
@@ -290,7 +321,7 @@ static pfunc stream_token(struct jv_parser* p, char ch) {
|
|
|
290
321
|
p->output = JV_ARRAY(jv_copy(p->path), p->next);
|
|
291
322
|
p->next = jv_invalid();
|
|
292
323
|
}
|
|
293
|
-
p->path = jv_array_set(p->path, p->stacklen - 1,
|
|
324
|
+
p->path = jv_array_set(p->path, p->stacklen - 1, jv_null()); // ready for another key:value pair
|
|
294
325
|
p->last_seen = JV_LAST_COMMA;
|
|
295
326
|
} else {
|
|
296
327
|
assert(k == JV_KIND_NULL);
|
|
@@ -462,7 +493,7 @@ static pfunc found_string(struct jv_parser* p) {
|
|
|
462
493
|
return "Invalid escape";
|
|
463
494
|
}
|
|
464
495
|
} else {
|
|
465
|
-
if (c
|
|
496
|
+
if (c >= 0 && c <= 0x001f)
|
|
466
497
|
return "Invalid string: control characters from U+0000 through U+001F must be escaped";
|
|
467
498
|
*out++ = c;
|
|
468
499
|
}
|
|
@@ -481,7 +512,13 @@ static pfunc check_literal(struct jv_parser* p) {
|
|
|
481
512
|
switch (p->tokenbuf[0]) {
|
|
482
513
|
case 't': pattern = "true"; plen = 4; v = jv_true(); break;
|
|
483
514
|
case 'f': pattern = "false"; plen = 5; v = jv_false(); break;
|
|
484
|
-
case '
|
|
515
|
+
case '\'':
|
|
516
|
+
return "Invalid string literal; expected \", but got '";
|
|
517
|
+
case 'n':
|
|
518
|
+
// if it starts with 'n', it could be a literal "nan"
|
|
519
|
+
if (p->tokenbuf[1] == 'u') {
|
|
520
|
+
pattern = "null"; plen = 4; v = jv_null();
|
|
521
|
+
}
|
|
485
522
|
}
|
|
486
523
|
if (pattern) {
|
|
487
524
|
if (p->tokenpos != plen) return "Invalid literal";
|
|
@@ -492,11 +529,20 @@ static pfunc check_literal(struct jv_parser* p) {
|
|
|
492
529
|
} else {
|
|
493
530
|
// FIXME: better parser
|
|
494
531
|
p->tokenbuf[p->tokenpos] = 0;
|
|
495
|
-
|
|
532
|
+
#ifdef USE_DECNUM
|
|
533
|
+
jv number = jv_number_with_literal(p->tokenbuf);
|
|
534
|
+
if (jv_get_kind(number) == JV_KIND_INVALID) {
|
|
535
|
+
return "Invalid numeric literal";
|
|
536
|
+
}
|
|
537
|
+
TRY(value(p, number));
|
|
538
|
+
#else
|
|
539
|
+
char *end = 0;
|
|
496
540
|
double d = jvp_strtod(&p->dtoa, p->tokenbuf, &end);
|
|
497
|
-
if (end == 0 || *end != 0)
|
|
541
|
+
if (end == 0 || *end != 0) {
|
|
498
542
|
return "Invalid numeric literal";
|
|
543
|
+
}
|
|
499
544
|
TRY(value(p, jv_number(d)));
|
|
545
|
+
#endif
|
|
500
546
|
}
|
|
501
547
|
p->tokenpos = 0;
|
|
502
548
|
return 0;
|
|
@@ -566,11 +612,11 @@ static int stream_check_done(struct jv_parser* p, jv* out) {
|
|
|
566
612
|
}
|
|
567
613
|
}
|
|
568
614
|
|
|
569
|
-
static int
|
|
570
|
-
return (
|
|
615
|
+
static int seq_check_truncation(struct jv_parser* p) {
|
|
616
|
+
return (!p->last_ch_was_ws && (p->stackpos > 0 || p->tokenpos > 0 || jv_get_kind(p->next) == JV_KIND_NUMBER));
|
|
571
617
|
}
|
|
572
618
|
|
|
573
|
-
static int
|
|
619
|
+
static int stream_seq_check_truncation(struct jv_parser* p) {
|
|
574
620
|
jv_kind k = jv_get_kind(p->next);
|
|
575
621
|
return (p->stacklen > 0 || k == JV_KIND_NUMBER || k == JV_KIND_TRUE || k == JV_KIND_FALSE || k == JV_KIND_NULL);
|
|
576
622
|
}
|
|
@@ -590,7 +636,7 @@ static int stream_is_top_num(struct jv_parser* p) {
|
|
|
590
636
|
(((p)->flags & JV_PARSE_STREAMING) ? stream_token((p), (ch)) : parse_token((p), (ch)))
|
|
591
637
|
|
|
592
638
|
#define check_truncation(p) \
|
|
593
|
-
(((p)->flags & JV_PARSE_STREAMING) ?
|
|
639
|
+
(((p)->flags & JV_PARSE_STREAMING) ? stream_seq_check_truncation((p)) : seq_check_truncation((p)))
|
|
594
640
|
|
|
595
641
|
#define is_top_num(p) \
|
|
596
642
|
(((p)->flags & JV_PARSE_STREAMING) ? stream_is_top_num((p)) : parse_is_top_num((p)))
|
|
@@ -601,7 +647,8 @@ static pfunc scan(struct jv_parser* p, char ch, jv* out) {
|
|
|
601
647
|
p->line++;
|
|
602
648
|
p->column = 0;
|
|
603
649
|
}
|
|
604
|
-
if (
|
|
650
|
+
if ((p->flags & JV_PARSE_SEQ)
|
|
651
|
+
&& ch == '\036' /* ASCII RS; see draft-ietf-json-sequence-07 */) {
|
|
605
652
|
if (check_truncation(p)) {
|
|
606
653
|
if (check_literal(p) == 0 && is_top_num(p))
|
|
607
654
|
return "Potentially truncated top-level numeric value";
|
|
@@ -814,9 +861,9 @@ jv jv_parser_next(struct jv_parser* p) {
|
|
|
814
861
|
}
|
|
815
862
|
}
|
|
816
863
|
|
|
817
|
-
jv
|
|
864
|
+
jv jv_parse_sized_custom_flags(const char* string, int length, int flags) {
|
|
818
865
|
struct jv_parser parser;
|
|
819
|
-
parser_init(&parser,
|
|
866
|
+
parser_init(&parser, flags);
|
|
820
867
|
jv_parser_set_buf(&parser, string, length, 0);
|
|
821
868
|
jv value = jv_parser_next(&parser);
|
|
822
869
|
if (jv_is_valid(value)) {
|
|
@@ -853,6 +900,14 @@ jv jv_parse_sized(const char* string, int length) {
|
|
|
853
900
|
return value;
|
|
854
901
|
}
|
|
855
902
|
|
|
903
|
+
jv jv_parse_sized(const char* string, int length) {
|
|
904
|
+
return jv_parse_sized_custom_flags(string, length, 0);
|
|
905
|
+
}
|
|
906
|
+
|
|
856
907
|
jv jv_parse(const char* string) {
|
|
857
908
|
return jv_parse_sized(string, strlen(string));
|
|
858
909
|
}
|
|
910
|
+
|
|
911
|
+
jv jv_parse_custom_flags(const char* string, int flags) {
|
|
912
|
+
return jv_parse_sized_custom_flags(string, strlen(string), flags);
|
|
913
|
+
}
|
package/deps/jq/src/jv_print.c
CHANGED
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
|
|
12
12
|
#include "jv.h"
|
|
13
13
|
#include "jv_dtoa.h"
|
|
14
|
+
#include "jv_dtoa_tsd.h"
|
|
14
15
|
#include "jv_unicode.h"
|
|
15
16
|
#include "jv_alloc.h"
|
|
17
|
+
#include "jv_private.h"
|
|
16
18
|
|
|
17
19
|
#ifndef MAX_PRINT_DEPTH
|
|
18
20
|
#define MAX_PRINT_DEPTH (256)
|
|
@@ -23,18 +25,16 @@
|
|
|
23
25
|
#define COLRESET (ESC "[0m")
|
|
24
26
|
|
|
25
27
|
// Color table. See https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
|
|
26
|
-
// for how to choose these.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
JV_KIND_STRING, JV_KIND_ARRAY, JV_KIND_OBJECT};
|
|
30
|
-
static char color_bufs[sizeof(color_kinds)/sizeof(color_kinds[0])][16];
|
|
28
|
+
// for how to choose these. The order is same as jv_kind definition, and
|
|
29
|
+
// the last color is used for object keys.
|
|
30
|
+
static char color_bufs[8][16];
|
|
31
31
|
static const char *color_bufps[8];
|
|
32
|
-
static const char* def_colors[] =
|
|
33
|
-
{COL("
|
|
34
|
-
COL("0;32"), COL("1;39"), COL("1;
|
|
35
|
-
#define FIELD_COLOR
|
|
32
|
+
static const char *const def_colors[] =
|
|
33
|
+
{COL("0;90"), COL("0;39"), COL("0;39"), COL("0;39"),
|
|
34
|
+
COL("0;32"), COL("1;39"), COL("1;39"), COL("1;34")};
|
|
35
|
+
#define FIELD_COLOR (colors[7])
|
|
36
36
|
|
|
37
|
-
static const char
|
|
37
|
+
static const char *const *colors = def_colors;
|
|
38
38
|
|
|
39
39
|
int
|
|
40
40
|
jq_set_colors(const char *c)
|
|
@@ -79,7 +79,7 @@ static void put_buf(const char *s, int len, FILE *fout, jv *strout, int is_tty)
|
|
|
79
79
|
if (len == -1)
|
|
80
80
|
len = strlen(s);
|
|
81
81
|
wl = MultiByteToWideChar(CP_UTF8, 0, s, len, NULL, 0);
|
|
82
|
-
ws = jv_mem_calloc(
|
|
82
|
+
ws = jv_mem_calloc(wl + 1, sizeof(*ws));
|
|
83
83
|
if (!ws)
|
|
84
84
|
return;
|
|
85
85
|
wl = MultiByteToWideChar(CP_UTF8, 0, s, len, ws, wl + 1);
|
|
@@ -192,14 +192,9 @@ static void jv_dump_term(struct dtoa_context* C, jv x, int flags, int indent, FI
|
|
|
192
192
|
char buf[JVP_DTOA_FMT_MAX_LEN];
|
|
193
193
|
const char* color = 0;
|
|
194
194
|
double refcnt = (flags & JV_PRINT_REFCOUNT) ? jv_get_refcnt(x) - 1 : -1;
|
|
195
|
-
if (flags & JV_PRINT_COLOR) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
color = colors[i];
|
|
199
|
-
put_str(color, F, S, flags & JV_PRINT_ISATTY);
|
|
200
|
-
break;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
195
|
+
if ((flags & JV_PRINT_COLOR) && jv_get_kind(x) != JV_KIND_INVALID) {
|
|
196
|
+
color = colors[(int)jv_get_kind(x) - 1];
|
|
197
|
+
put_str(color, F, S, flags & JV_PRINT_ISATTY);
|
|
203
198
|
}
|
|
204
199
|
if (indent > MAX_PRINT_DEPTH) {
|
|
205
200
|
put_str("<skipped: too deep>", F, S, flags & JV_PRINT_ISATTY);
|
|
@@ -211,7 +206,7 @@ static void jv_dump_term(struct dtoa_context* C, jv x, int flags, int indent, FI
|
|
|
211
206
|
if (jv_get_kind(msg) == JV_KIND_STRING) {
|
|
212
207
|
put_str("<invalid:", F, S, flags & JV_PRINT_ISATTY);
|
|
213
208
|
jvp_dump_string(msg, flags | JV_PRINT_ASCII, F, S, flags & JV_PRINT_ISATTY);
|
|
214
|
-
|
|
209
|
+
put_char('>', F, S, flags & JV_PRINT_ISATTY);
|
|
215
210
|
} else {
|
|
216
211
|
put_str("<invalid>", F, S, flags & JV_PRINT_ISATTY);
|
|
217
212
|
}
|
|
@@ -229,16 +224,29 @@ static void jv_dump_term(struct dtoa_context* C, jv x, int flags, int indent, FI
|
|
|
229
224
|
put_str("true", F, S, flags & JV_PRINT_ISATTY);
|
|
230
225
|
break;
|
|
231
226
|
case JV_KIND_NUMBER: {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
// JSON doesn't have NaN, so we'll render it as "null"
|
|
235
|
-
put_str("null", F, S, flags & JV_PRINT_ISATTY);
|
|
227
|
+
if (jvp_number_is_nan(x)) {
|
|
228
|
+
jv_dump_term(C, jv_null(), flags, indent, F, S);
|
|
236
229
|
} else {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
if (
|
|
240
|
-
|
|
230
|
+
#ifdef USE_DECNUM
|
|
231
|
+
const char * literal_data = jv_number_get_literal(x);
|
|
232
|
+
if (literal_data) {
|
|
233
|
+
put_str(literal_data, F, S, flags & JV_PRINT_ISATTY);
|
|
234
|
+
} else {
|
|
235
|
+
#endif
|
|
236
|
+
double d = jv_number_value(x);
|
|
237
|
+
if (d != d) {
|
|
238
|
+
// JSON doesn't have NaN, so we'll render it as "null"
|
|
239
|
+
put_str("null", F, S, flags & JV_PRINT_ISATTY);
|
|
240
|
+
} else {
|
|
241
|
+
// Normalise infinities to something we can print in valid JSON
|
|
242
|
+
if (d > DBL_MAX) d = DBL_MAX;
|
|
243
|
+
if (d < -DBL_MAX) d = -DBL_MAX;
|
|
244
|
+
put_str(jvp_dtoa_fmt(C, buf, d), F, S, flags & JV_PRINT_ISATTY);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
#ifdef USE_DECNUM
|
|
241
248
|
}
|
|
249
|
+
#endif
|
|
242
250
|
break;
|
|
243
251
|
}
|
|
244
252
|
case JV_KIND_STRING:
|
|
@@ -251,22 +259,18 @@ static void jv_dump_term(struct dtoa_context* C, jv x, int flags, int indent, FI
|
|
|
251
259
|
put_str("[]", F, S, flags & JV_PRINT_ISATTY);
|
|
252
260
|
break;
|
|
253
261
|
}
|
|
254
|
-
|
|
255
|
-
if (flags & JV_PRINT_PRETTY) {
|
|
256
|
-
put_char('\n', F, S, flags & JV_PRINT_ISATTY);
|
|
257
|
-
put_indent(indent + 1, flags, F, S, flags & JV_PRINT_ISATTY);
|
|
258
|
-
}
|
|
262
|
+
put_char('[', F, S, flags & JV_PRINT_ISATTY);
|
|
259
263
|
jv_array_foreach(x, i, elem) {
|
|
260
264
|
if (i!=0) {
|
|
261
|
-
if (flags &
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
265
|
+
if (color) put_str(color, F, S, flags & JV_PRINT_ISATTY);
|
|
266
|
+
put_char(',', F, S, flags & JV_PRINT_ISATTY);
|
|
267
|
+
}
|
|
268
|
+
if (color) put_str(COLRESET, F, S, flags & JV_PRINT_ISATTY);
|
|
269
|
+
if (flags & JV_PRINT_PRETTY) {
|
|
270
|
+
put_char('\n', F, S, flags & JV_PRINT_ISATTY);
|
|
271
|
+
put_indent(indent + 1, flags, F, S, flags & JV_PRINT_ISATTY);
|
|
267
272
|
}
|
|
268
273
|
jv_dump_term(C, elem, flags, indent + 1, F, S);
|
|
269
|
-
if (color) put_str(color, F, S, flags & JV_PRINT_ISATTY);
|
|
270
274
|
}
|
|
271
275
|
if (flags & JV_PRINT_PRETTY) {
|
|
272
276
|
put_char('\n', F, S, flags & JV_PRINT_ISATTY);
|
|
@@ -284,10 +288,6 @@ static void jv_dump_term(struct dtoa_context* C, jv x, int flags, int indent, FI
|
|
|
284
288
|
break;
|
|
285
289
|
}
|
|
286
290
|
put_char('{', F, S, flags & JV_PRINT_ISATTY);
|
|
287
|
-
if (flags & JV_PRINT_PRETTY) {
|
|
288
|
-
put_char('\n', F, S, flags & JV_PRINT_ISATTY);
|
|
289
|
-
put_indent(indent + 1, flags, F, S, flags & JV_PRINT_ISATTY);
|
|
290
|
-
}
|
|
291
291
|
int first = 1;
|
|
292
292
|
int i = 0;
|
|
293
293
|
jv keyset = jv_null();
|
|
@@ -318,14 +318,14 @@ static void jv_dump_term(struct dtoa_context* C, jv x, int flags, int indent, FI
|
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
if (!first) {
|
|
321
|
-
if (flags &
|
|
322
|
-
|
|
323
|
-
put_indent(indent + 1, flags, F, S, flags & JV_PRINT_ISATTY);
|
|
324
|
-
} else {
|
|
325
|
-
put_str(",", F, S, flags & JV_PRINT_ISATTY);
|
|
326
|
-
}
|
|
321
|
+
if (color) put_str(color, F, S, flags & JV_PRINT_ISATTY);
|
|
322
|
+
put_char(',', F, S, flags & JV_PRINT_ISATTY);
|
|
327
323
|
}
|
|
328
324
|
if (color) put_str(COLRESET, F, S, flags & JV_PRINT_ISATTY);
|
|
325
|
+
if (flags & JV_PRINT_PRETTY) {
|
|
326
|
+
put_char('\n', F, S, flags & JV_PRINT_ISATTY);
|
|
327
|
+
put_indent(indent + 1, flags, F, S, flags & JV_PRINT_ISATTY);
|
|
328
|
+
}
|
|
329
329
|
|
|
330
330
|
first = 0;
|
|
331
331
|
if (color) put_str(FIELD_COLOR, F, S, flags & JV_PRINT_ISATTY);
|
|
@@ -334,11 +334,13 @@ static void jv_dump_term(struct dtoa_context* C, jv x, int flags, int indent, FI
|
|
|
334
334
|
if (color) put_str(COLRESET, F, S, flags & JV_PRINT_ISATTY);
|
|
335
335
|
|
|
336
336
|
if (color) put_str(color, F, S, flags & JV_PRINT_ISATTY);
|
|
337
|
-
|
|
337
|
+
put_char(':', F, S, flags & JV_PRINT_ISATTY);
|
|
338
338
|
if (color) put_str(COLRESET, F, S, flags & JV_PRINT_ISATTY);
|
|
339
|
+
if (flags & JV_PRINT_PRETTY) {
|
|
340
|
+
put_char(' ', F, S, flags & JV_PRINT_ISATTY);
|
|
341
|
+
}
|
|
339
342
|
|
|
340
343
|
jv_dump_term(C, value, flags, indent + 1, F, S);
|
|
341
|
-
if (color) put_str(color, F, S, flags & JV_PRINT_ISATTY);
|
|
342
344
|
}
|
|
343
345
|
if (flags & JV_PRINT_PRETTY) {
|
|
344
346
|
put_char('\n', F, S, flags & JV_PRINT_ISATTY);
|
|
@@ -357,10 +359,7 @@ static void jv_dump_term(struct dtoa_context* C, jv x, int flags, int indent, FI
|
|
|
357
359
|
}
|
|
358
360
|
|
|
359
361
|
void jv_dumpf(jv x, FILE *f, int flags) {
|
|
360
|
-
|
|
361
|
-
jvp_dtoa_context_init(&C);
|
|
362
|
-
jv_dump_term(&C, x, flags, 0, f, 0);
|
|
363
|
-
jvp_dtoa_context_free(&C);
|
|
362
|
+
jv_dump_term(tsd_dtoa_context_get(), x, flags, 0, f, 0);
|
|
364
363
|
}
|
|
365
364
|
|
|
366
365
|
void jv_dump(jv x, int flags) {
|
|
@@ -376,11 +375,8 @@ void jv_show(jv x, int flags) {
|
|
|
376
375
|
}
|
|
377
376
|
|
|
378
377
|
jv jv_dump_string(jv x, int flags) {
|
|
379
|
-
struct dtoa_context C;
|
|
380
|
-
jvp_dtoa_context_init(&C);
|
|
381
378
|
jv s = jv_string("");
|
|
382
|
-
jv_dump_term(
|
|
383
|
-
jvp_dtoa_context_free(&C);
|
|
379
|
+
jv_dump_term(tsd_dtoa_context_get(), x, flags, 0, 0, &s);
|
|
384
380
|
return s;
|
|
385
381
|
}
|
|
386
382
|
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#ifndef JV_THREAD_H
|
|
2
|
+
#define JV_THREAD_H
|
|
3
|
+
|
|
4
|
+
#ifdef WIN32
|
|
5
|
+
#ifndef __MINGW32__
|
|
6
|
+
#include <windows.h>
|
|
7
|
+
#include <winnt.h>
|
|
8
|
+
#include <errno.h>
|
|
9
|
+
|
|
10
|
+
/* Copied from Heimdal: pthread-like mutexes for WIN32 -- see lib/base/heimbase.h in Heimdal */
|
|
11
|
+
typedef struct pthread_mutex {
|
|
12
|
+
HANDLE h;
|
|
13
|
+
} pthread_mutex_t;
|
|
14
|
+
|
|
15
|
+
#define PTHREAD_MUTEX_INITIALIZER { INVALID_HANDLE_VALUE }
|
|
16
|
+
|
|
17
|
+
static inline int
|
|
18
|
+
pthread_mutex_init(pthread_mutex_t *m)
|
|
19
|
+
{
|
|
20
|
+
m->h = CreateSemaphore(NULL, 1, 1, NULL);
|
|
21
|
+
if (m->h == INVALID_HANDLE_VALUE)
|
|
22
|
+
return EAGAIN;
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static inline int
|
|
27
|
+
pthread_mutex_lock(pthread_mutex_t *m)
|
|
28
|
+
{
|
|
29
|
+
HANDLE h, new_h;
|
|
30
|
+
int created = 0;
|
|
31
|
+
|
|
32
|
+
h = InterlockedCompareExchangePointer(&m->h, m->h, m->h);
|
|
33
|
+
if (h == INVALID_HANDLE_VALUE || h == NULL) {
|
|
34
|
+
created = 1;
|
|
35
|
+
new_h = CreateSemaphore(NULL, 0, 1, NULL);
|
|
36
|
+
if (new_h == INVALID_HANDLE_VALUE)
|
|
37
|
+
return EAGAIN;
|
|
38
|
+
if (InterlockedCompareExchangePointer(&m->h, new_h, h) != h) {
|
|
39
|
+
created = 0;
|
|
40
|
+
CloseHandle(new_h);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (!created)
|
|
44
|
+
WaitForSingleObject(m->h, INFINITE);
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static inline int
|
|
49
|
+
pthread_mutex_unlock(pthread_mutex_t *m)
|
|
50
|
+
{
|
|
51
|
+
if (ReleaseSemaphore(m->h, 1, NULL) == FALSE)
|
|
52
|
+
return EPERM;
|
|
53
|
+
return 0;
|
|
54
|
+
}
|
|
55
|
+
static inline int
|
|
56
|
+
pthread_mutex_destroy(pthread_mutex_t *m)
|
|
57
|
+
{
|
|
58
|
+
HANDLE h;
|
|
59
|
+
|
|
60
|
+
h = InterlockedCompareExchangePointer(&m->h, INVALID_HANDLE_VALUE, m->h);
|
|
61
|
+
if (h != INVALID_HANDLE_VALUE)
|
|
62
|
+
CloseHandle(h);
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
typedef unsigned long pthread_key_t;
|
|
67
|
+
int pthread_key_create(pthread_key_t *, void (*)(void *));
|
|
68
|
+
int pthread_setspecific(pthread_key_t, void *);
|
|
69
|
+
void *pthread_getspecific(pthread_key_t);
|
|
70
|
+
#else
|
|
71
|
+
#include <pthread.h>
|
|
72
|
+
#endif
|
|
73
|
+
#else
|
|
74
|
+
#include <pthread.h>
|
|
75
|
+
#endif
|
|
76
|
+
#endif /* JV_THREAD_H */
|
package/deps/jq/src/jv_unicode.c
CHANGED
|
@@ -118,3 +118,21 @@ int jvp_utf8_encode(int codepoint, char* out) {
|
|
|
118
118
|
assert(out - start == jvp_utf8_encode_length(codepoint));
|
|
119
119
|
return out - start;
|
|
120
120
|
}
|
|
121
|
+
|
|
122
|
+
// characters with White_Space property in:
|
|
123
|
+
// https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
|
124
|
+
int jvp_codepoint_is_whitespace(int c) {
|
|
125
|
+
return
|
|
126
|
+
(c >= 0x0009 && c <= 0x000D) || // <control-0009>..<control-000D>
|
|
127
|
+
c == 0x0020 || // SPACE
|
|
128
|
+
c == 0x0085 || // <control-0085>
|
|
129
|
+
c == 0x00A0 || // NO-BREAK SPACE
|
|
130
|
+
c == 0x1680 || // OGHAM SPACE MARK
|
|
131
|
+
(c >= 0x2000 && c <= 0x200A) || // EN QUAD..HAIR SPACE
|
|
132
|
+
c == 0x2028 || // LINE SEPARATOR
|
|
133
|
+
c == 0x2029 || // PARAGRAPH SEPARATOR
|
|
134
|
+
c == 0x202F || // NARROW NO-BREAK SPACE
|
|
135
|
+
c == 0x205F || // MEDIUM MATHEMATICAL SPACE
|
|
136
|
+
c == 0x3000 // IDEOGRAPHIC SPACE
|
|
137
|
+
;
|
|
138
|
+
}
|